XineStream::XineStream(XineEngine &e, const string &mrl):
engine(e),
+ filename(mrl.substr(mrl.rfind('/')+1)),
state(STOPPED),
+ title(filename),
current_audio(0),
current_spu(OFF),
channels_changed(false)
engine.add_stream(*this);
}
+const string &XineStream::get_title() const
+{
+ return title.empty() ? filename : title;
+}
+
XineStream::~XineStream()
{
engine.remove_stream(*this);
{
MutexLock lock(mutex);
title = (xt ? xt : string());
- signal_title_changed.emit(title);
+ signal_title_changed.emit(get_title());
}
int dur_msec, pos_msec;
private:
XineEngine &engine;
+ std::string filename;
xine_stream_t *stream;
xine_event_queue_t *queue;
Msp::Mutex mutex;
State get_state() const { return state; }
const Msp::Time::TimeDelta &get_duration() const { return duration; }
const Msp::Time::TimeDelta &get_position() const { return position; }
- const std::string &get_title() const { return title; }
+ const std::string &get_title() const;
void play();
void seek(const Msp::Time::TimeDelta &);