1 #include <sigc++/bind.h>
2 #include <msp/fs/dir.h>
3 #include <msp/graphics/display_private.h>
4 #include <msp/time/utils.h>
5 #include "xineengine.h"
7 #include "xinestream.h"
12 Xinema::EarlyInit::EarlyInit()
18 Xinema::Xinema(int, char **):
19 window(display, 1920, 1080),
26 window.signal_close.connect(sigc::bind(sigc::mem_fun(this, &Xinema::exit), 0));
34 engine = new XineEngine(window);
51 MutexLock lock(command_mutex);
60 bool had_stream = stream;
65 if(had_stream && !logo_mode)
66 signal_stream_destroyed.emit();
69 stream = new XineStream(*engine, mrl);
71 stream->signal_finished.connect(sigc::mem_fun(this, &Xinema::show_logo));
75 signal_stream_created.emit(*stream);
78 XLockDisplay(display.get_private().display);
80 XUnlockDisplay(display.get_private().display);
84 Time::sleep(10*Time::msec);
87 void Xinema::play_file(const FS::Path &fn)
89 MutexLock lock(command_mutex);
90 pending_mrl = "file://"+fn.str();
94 void Xinema::show_logo()
96 MutexLock lock(command_mutex);
97 pending_mrl = "file://"+(FS::get_sys_data_dir()/"xinema.png").str();