X-Git-Url: http://git.tdb.fi/?p=xinema.git;a=blobdiff_plain;f=remote%2Fsource%2Fstreamcontrolitem.cpp;h=fb518bf0ab8fd102a645edcac30d42d0160b156b;hp=b7624df813d6c5f45cbe24cf99171fdeb84320f5;hb=857fbdc12041b7f01f45d4dcf2208f9dccf29294;hpb=a5fc8a4255dabc9d5d514e597a7b19ffd5baf793 diff --git a/remote/source/streamcontrolitem.cpp b/remote/source/streamcontrolitem.cpp index b7624df..fb518bf 100644 --- a/remote/source/streamcontrolitem.cpp +++ b/remote/source/streamcontrolitem.cpp @@ -19,6 +19,9 @@ void StreamControlItem::set_control(XinemaControlItem *c) connect(&xc, &XinemaControl::title_changed, this, &StreamControlItem::title_changed); connect(&xc, &XinemaControl::duration_changed, this, &StreamControlItem::duration_changed); connect(&xc, &XinemaControl::position_changed, this, &StreamControlItem::position_changed); + connect(&xc, &XinemaControl::channels_changed, this, &StreamControlItem::control_channels_changed); + connect(&xc, &XinemaControl::current_audio_channel_changed, this, &StreamControlItem::current_audio_channel_changed); + connect(&xc, &XinemaControl::current_spu_channel_changed, this, &StreamControlItem::current_spu_channel_changed); } emit control_changed(); @@ -29,6 +32,9 @@ void StreamControlItem::set_control(XinemaControlItem *c) emit title_changed(); emit duration_changed(); emit position_changed(); + emit channels_changed(); + emit current_audio_channel_changed(); + emit current_spu_channel_changed(); } } @@ -83,3 +89,54 @@ float StreamControlItem::get_position() const return control->get_control().get_position(); } + +QStringList StreamControlItem::get_audio_channels() const +{ + if(!control) + return QStringList(); + + return control->get_control().get_audio_channels(); +} + +QStringList StreamControlItem::get_spu_channels() const +{ + if(!control) + return QStringList(); + + return control->get_control().get_spu_channels(); +} + +void StreamControlItem::select_audio_channel(int chan) +{ + if(control) + control->get_control().select_audio_channel(chan); +} + +void StreamControlItem::select_spu_channel(int chan) +{ + if(control) + control->get_control().select_spu_channel(chan); +} + +int StreamControlItem::get_current_audio_channel() const +{ + if(!control) + return -1; + + return control->get_control().get_current_audio_channel(); +} + +int StreamControlItem::get_current_spu_channel() const +{ + if(!control) + return -1; + + return control->get_control().get_current_spu_channel(); +} + +void StreamControlItem::control_channels_changed() +{ + emit channels_changed(); + emit current_audio_channel_changed(); + emit current_spu_channel_changed(); +}