Commit fc802f00 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

qt: add get-media wrapper

(leaks are left untouched)
parent ad41e997
......@@ -284,13 +284,12 @@ void VLMDialog::mediasPopulator()
{
if( p_vlm )
{
int i_nMedias;
QString typeShortName;
int vlmItemCount;
vlm_media_t **pp_dsc;
/* Get medias information and numbers */
vlm_Control( p_vlm, VLM_GET_MEDIAS, &pp_dsc, &i_nMedias );
int i_nMedias = VLMWrapper::GetMedias( pp_dsc );
/* Loop on all of them */
for( int i = 0; i < i_nMedias; i++ )
......@@ -660,6 +659,14 @@ VLMWrapper::~VLMWrapper()
p_vlm = NULL;
}
int VLMWrapper::GetMedias( vlm_media_t **& array )
{
int count;
vlm_Control( p_vlm, VLM_GET_MEDIAS, &array, &count );
return count;
}
void VLMWrapper::AddBroadcast( const QString& name, const QString& input,
const QString& inputOptions, const QString& output,
bool b_enabled, bool b_loop )
......
......@@ -114,6 +114,8 @@ public:
VLMWrapper( vlm_t * );
virtual ~VLMWrapper();
static int GetMedias( vlm_media_t **& );
static void AddBroadcast( const QString&, const QString&,
const QString&, const QString&,
bool b_enabled = true, bool b_loop = false );
......@@ -143,11 +145,6 @@ public:
static void SaveConfig( const QString& );
static bool LoadConfig( const QString& );
/* 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:
static vlm_t *p_vlm;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment