VLMDialog *VLMDialog::instance = NULL;
VLMDialog::VLMDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
-{
- vlmWrapper = new VLMWrapper( p_intf );
- if( !vlmWrapper->AttachVLM() )
+{
+ p_vlm = vlm_New( p_intf );
+
+ if( !p_vlm )
{
msg_Warn( p_intf, "Couldn't build VLM object ");
return;
}
+ vlmWrapper = new VLMWrapper( p_vlm );
// UI stuff
ui.setupUi( this );
VLMDialog::~VLMDialog()
{
- delete vlmWrapper;
+ /* FIXME :you have to destroy vlm here to close
+ * but we shouldn't destroy vlm here in case somebody else wants it */
+ if( p_vlm )
+ vlm_Delete( p_vlm );
}
void VLMDialog::showScheduleWidget( int i )
typeShortName = "Bcast";
vlmAwidget = new VLMBroadcast( name, inputText, outputText,
b_checked, b_looped, this );
- VLMWrapper::AddBroadcast( vlmWrapper->GetVLM(), name, inputText, outputText, b_checked, b_looped );
+ //VLMWrapper::AddBroadcast( vlmWrapper->p_vlc, name, inputText, outputText, b_checked, b_looped );
break;
case QVLM_VOD:
typeShortName = "VOD";
vlmAwidget = new VLMVod( name, inputText, outputText,
b_checked, ui.muxLedit->text(), this );
- VLMWrapper::AddVod( vlmWrapper->GetVLM(), name, inputText, outputText, b_checked );
+ ///VLMWrapper::AddVod( vlmWrapper->GetVLM(), name, inputText, outputText, b_checked );
break;
case QVLM_Schedule:
typeShortName = "Sched";
void VLMBroadcast::update()
{
- VLMWrapper::EditBroadcast( THEVLM, name, input, output, b_enabled, b_looped );
+ //VLMWrapper::EditBroadcast( VLMWrapper::p_vlm, name, input, output, b_enabled, b_looped );
if( b_looped )
loopButton->setIcon( QIcon( QPixmap( ":/pixmaps/playlist_repeat_all.png" ) ) );
else
{
if( b_playing = true )
{
- VLMWrapper::ControlBroadcast( THEVLM, name, ControlBroadcastPause );
+ // VLMWrapper::ControlBroadcast( VLMWrapper::p_vlm, name, ControlBroadcastPause );
playButton->setIcon( QIcon( QPixmap( ":/pixmaps/pause_16px.png" ) ) );
}
else
{
- VLMWrapper::ControlBroadcast( THEVLM, name, ControlBroadcastPlay );
+ //VLMWrapper::ControlBroadcast( VLMWrapper::p_vlm, name, ControlBroadcastPlay );
playButton->setIcon( QIcon( QPixmap( ":/pixmaps/play_16px.png" ) ) );
}
b_playing = !b_playing;
void VLMBroadcast::stop()
{
- VLMWrapper::ControlBroadcast( THEVLM, name, ControlBroadcastStop );
+ //VLMWrapper::ControlBroadcast( VLMWrapper::p_vlm, name, ControlBroadcastStop );
playButton->setIcon( QIcon( QPixmap( ":/pixmaps/play_16px.png" ) ) );
}
void VLMVod::update()
{
muxLabel->setText( mux );
- VLMWrapper::EditVod( THEVLM, name, input, output, b_enabled, mux );
+ //VLMWrapper::EditVod( p_vlm, name, input, output, b_enabled, mux );
}
/*******************
* VLMWrapper
*******************/
-VLMWrapper::VLMWrapper( intf_thread_t *_p_intf )
-{
- p_intf = _p_intf;
- p_vlm = vlm_New( p_intf );
-}
+vlm_t * VLMWrapper::p_vlm = NULL;
-VLMWrapper::~VLMWrapper()
+VLMWrapper::VLMWrapper( vlm_t *_p_vlm )
{
- /* FIXME :you have to destroy vlm here to close
- * but we shouldn't destroy vlm here in case somebody else wants it */
- if( p_vlm )
- vlm_Delete( p_vlm );
+ p_vlm = _p_vlm;
}
-bool VLMWrapper::AttachVLM()
-{
- p_vlm = vlm_New( p_intf );
- return (p_vlm ? true: false );
-}
+VLMWrapper::~VLMWrapper()
+{}
-void VLMWrapper::AddBroadcast( vlm_t *p_vlm, const QString name, QString input,
+void VLMWrapper::AddBroadcast( const QString name, QString input,
QString output,
bool b_enabled, bool b_loop )
{
QString command = "new \"" + name + "\" broadcast";
vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
vlm_MessageDelete( message );
- EditBroadcast( p_vlm, name, input, output, b_enabled, b_loop );
+ EditBroadcast( name, input, output, b_enabled, b_loop );
}
-void VLMWrapper::EditBroadcast( vlm_t *p_vlm, const QString name, const QString input,
+void VLMWrapper::EditBroadcast( const QString name, const QString input,
const QString output,
bool b_enabled, bool b_loop )
{
}
}
-void VLMWrapper::ControlBroadcast( vlm_t *p_vlm, const QString name, int BroadcastStatus,
+void VLMWrapper::ControlBroadcast( const QString name, int BroadcastStatus,
unsigned int seek )
{
vlm_message_t *message;
vlm_MessageDelete( message );
}
-void VLMWrapper::AddVod( vlm_t *p_vlm, const QString name, const QString input,
+void VLMWrapper::AddVod( const QString name, const QString input,
const QString output,
bool b_enabled, const QString mux )
{
QString command = "new \"" + name + "\" vod";
vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
vlm_MessageDelete( message );
- EditVod( p_vlm, name, input, output, b_enabled, mux );
+ EditVod( name, input, output, b_enabled, mux );
}
-void VLMWrapper::EditVod( vlm_t *p_vlm, const QString name, const QString input,
+void VLMWrapper::EditVod( const QString name, const QString input,
const QString output,
bool b_enabled,
const QString mux )
class VLMAWidget;
class VLMWrapper;
-#define THEVLM parent->vlmWrapper->GetVLM()
class VLMDialog : public QVLCFrame
{
virtual ~VLMDialog();
VLMWrapper *vlmWrapper;
-
+vlm_t *p_vlm;
private:
VLMDialog( intf_thread_t * );
static VLMDialog *instance;
class VLMWrapper
{
public:
- VLMWrapper( intf_thread_t * );
+ VLMWrapper( vlm_t * );
virtual ~VLMWrapper();
- bool AttachVLM();
-
- static void AddBroadcast( vlm_t *, const QString, const QString, const QString,
+ static void AddBroadcast( const QString, const QString, const QString,
bool b_enabled = true,
bool b_loop = false );
- static void EditBroadcast( vlm_t *, const QString, const QString, const QString,
+ static void EditBroadcast( const QString, const QString, const QString,
bool b_enabled = true,
bool b_loop = false );
- static void AddVod( vlm_t *, const QString, const QString, const QString,
+ static void AddVod( const QString, const QString, const QString,
bool b_enabled = true, QString mux = "" );
- static void EditVod( vlm_t *, const QString, const QString, const QString,
+ static void EditVod( const QString, const QString, const QString,
bool b_enabled = true, QString mux = "" );
- static void ControlBroadcast( vlm_t *, const QString, int, unsigned int seek = 0 );
+ static void ControlBroadcast( const QString, int, unsigned int seek = 0 );
- vlm_t * GetVLM(){ return p_vlm;}
/* We don't have yet the accessors in the core, so the following is commented */
//unsigned int NbMedia() { if( p_vlm ) return p_vlm->i_media; return 0; }
/* vlm_media_t *GetMedia( int i )
{ if( p_vlm ) return p_vlm->media[i]; return NULL; }*/
private:
- vlm_t *p_vlm;
- intf_thread_t *p_intf;
+ static vlm_t *p_vlm;
};
class VLMAWidget : public QGroupBox