void VLMWrapper::EditVod( const QString& name, const QString& input, const QString& inputOptions, const QString& output, bool b_enabled, const QString& mux ) { vlm_message_t *message; QString command; if( !input.isEmpty() ) { command = "setup \"" + name + "\" input \"" + input + "\""; vlm_ExecuteCommand( p_vlm, qtu( command ), &message ); vlm_MessageDelete( message ); QStringList options = inputOptions.split( " :", QString::SkipEmptyParts ); for( int i = 0; i < options.size(); i++ ) { command = "setup \"" + name + "\" option \"" + options[i].trimmed() + "\""; vlm_ExecuteCommand( p_vlm, qtu( command ), &message ); vlm_MessageDelete( message ); } } if( !output.isEmpty() ) { command = "setup \"" + name + "\" output \"" + output + "\""; vlm_ExecuteCommand( p_vlm, qtu( command ), &message ); vlm_MessageDelete( message ); } if( b_enabled ) { command = "setup \"" + name + "\" enabled"; vlm_ExecuteCommand( p_vlm, qtu( command ), &message ); vlm_MessageDelete( message ); } if( !mux.isEmpty() ) { command = "setup \"" + name + "\" mux \"" + mux + "\""; vlm_ExecuteCommand( p_vlm, qtu( command ), &message ); vlm_MessageDelete( message ); } }
void VLMWrapper::AddVod( const QString& name, const QString& input, const QString& inputOptions, const QString& output, bool b_enabled, const QString& mux ) { vlm_message_t *message; QString command = "new \"" + name + "\" vod"; vlm_ExecuteCommand( p_vlm, qtu( command ), &message ); vlm_MessageDelete( message ); EditVod( name, input, inputOptions, output, b_enabled, mux ); }
void VLMWrapper::AddBroadcast( const QString& name, const QString& input, const QString& inputOptions, const QString& output, bool b_enabled, bool b_loop ) { vlm_message_t *message; QString command = "new \"" + name + "\" broadcast"; vlm_ExecuteCommand( p_vlm, qtu( command ), &message ); vlm_MessageDelete( message ); EditBroadcast( name, input, inputOptions, output, b_enabled, b_loop ); }
/* Check for updates */ void UpdateDialog::UpdateOrDownload() { if( !b_checked ) { ui.stackedWidget->setCurrentWidget( ui.updateRequestPage ); update_Check( p_update, UpdateCallback, this ); } else { QString dest_dir = QDir::tempPath(); if( !dest_dir.isEmpty() ) { dest_dir = toNativeSepNoSlash( dest_dir ) + DIR_SEP; msg_Dbg( p_intf, "Downloading to folder: %s", qtu( dest_dir ) ); toggleVisible(); update_Download( p_update, qtu( dest_dir ) ); /* FIXME: We should trigger a change to another dialog here ! */ } } }
void OpenDialog::stream( bool b_transcode_only ) { QString soutMRL = getMRL( false ); if( soutMRL.isEmpty() ) return; toggleVisible(); /* Dbg and send :D */ msg_Dbg( p_intf, "MRL passed to the Sout: %s", qtu( soutMRL ) ); THEDP->streamingDialog( this, soutMRL, b_transcode_only, ui.advancedLineInput->text().split( " :" ) ); }
int Open::openMRLwithOptions( intf_thread_t* p_intf, const QString &mrl, QStringList *options, bool b_start, bool b_playlist, const char *title) { /* Options */ const char **ppsz_options = NULL; int i_options = 0; if( options != NULL && options->count() > 0 ) { ppsz_options = new const char *[options->count()]; for( int j = 0; j < options->count(); j++ ) { QString option = colon_unescape( options->at(j) ); if( !option.isEmpty() ) { ppsz_options[i_options] = strdup(qtu(option)); i_options++; } } } /* Add to playlist */ int i_ret = playlist_AddExt( THEPL, qtu(mrl), title, b_start, i_options, ppsz_options, VLC_INPUT_OPTION_TRUSTED, b_playlist ); /* Add to recent items, only if played */ if( i_ret == VLC_SUCCESS && b_start && b_playlist ) RecentsMRL::getInstance( p_intf )->addRecent( mrl ); /* Free options */ if ( ppsz_options != NULL ) { for ( int i = 0; i < i_options; ++i ) free( (char*)ppsz_options[i] ); delete[] ppsz_options; } return i_ret; }
void VLMWrapper::AddSchedule( const QString& name, const QString& input, const QString& inputOptions, const QString& output, QDateTime _schetime, QDateTime _schedate, int _scherepeatnumber, int _repeatDays, bool b_enabled, const QString& mux ) { vlm_message_t *message; QString command = "new \"" + name + "\" schedule"; vlm_ExecuteCommand( p_vlm, qtu( command ), &message ); vlm_MessageDelete( message ); EditSchedule( name, input, inputOptions, output, _schetime, _schedate, _scherepeatnumber, _repeatDays, b_enabled, mux ); }
QString toURI( const QString& s ) { if( s.contains( qfu("://") ) ) return s; char *psz = vlc_path2uri( qtu(s), NULL ); if( psz == NULL ) return qfu(""); QString uri = qfu( psz ); free( psz ); return uri; }
/* Check for updates */ void UpdateDialog::UpdateOrDownload() { if( !b_checked ) { updateButton->setEnabled( false ); updateLabelTop->setText( qtr( "Launching an update request..." ) ); update_Check( p_update, UpdateCallback, this ); } else { QString dest_dir = QFileDialog::getExistingDirectory( this, qtr( "Select a directory..." ), qfu( config_GetHomeDir() ) ); if( !dest_dir.isEmpty() ) { dest_dir = toNativeSepNoSlash( dest_dir ) + DIR_SEP; msg_Dbg( p_intf, "Downloading to folder: %s", qtu( dest_dir ) ); toggleVisible(); update_Download( p_update, qtu( dest_dir ) ); } } }
/** * Open a file, * pl helps you to choose from playlist or media library, * go to start or enqueue **/ void DialogsProvider::addFromSimple( bool pl, bool go) { QStringList files = DialogsProvider::showSimpleOpen(); int mode = go ? PLAYLIST_GO : PLAYLIST_PREPARSE; files.sort(); foreach( const QString &file, files ) { QString url = toURI( toNativeSeparators( file ) ); playlist_Add( THEPL, qtu( url ), NULL, PLAYLIST_APPEND | mode, PLAYLIST_END, pl, pl_Unlocked ); RecentsMRL::getInstance( p_intf )->addRecent( url ); mode = PLAYLIST_PREPARSE; }
playlist_item_t *RecentsMRL::toPlaylist(int length) { playlist_item_t *p_node_recent = playlist_NodeCreate(THEPL, _("Recently Played"), THEPL->p_root, PLAYLIST_END, PLAYLIST_RO_FLAG, NULL); if ( p_node_recent == NULL ) return NULL; if (length == 0 || recents.count() < length) length = recents.count(); for (int i = 0; i < length; i++) { input_item_t *p_input = input_item_New(qtu(recents.at(i)), NULL); playlist_NodeAddInput(THEPL, p_input, p_node_recent, PLAYLIST_APPEND, PLAYLIST_END, false); } return p_node_recent; }
/** * Open a file, * pl helps you to choose from playlist or media library, * go to start or enqueue **/ void DialogsProvider::addFromSimple( bool pl, bool go) { QStringList files = DialogsProvider::showSimpleOpen(); int i = 0; files.sort(); foreach( const QString &file, files ) { playlist_Add( THEPL, qtu( toNativeSeparators( file ) ), NULL, go ? ( PLAYLIST_APPEND | ( i ? 0 : PLAYLIST_GO ) | ( i ? PLAYLIST_PREPARSE : 0 ) ) : ( PLAYLIST_APPEND | PLAYLIST_PREPARSE ), PLAYLIST_END, pl ? true : false, false ); RecentsMRL::getInstance( p_intf )->addRecent( toNativeSeparators( file ) ); i++; }
/* TODO : VOD are not exported to the file */ bool VLMDialog::exportVLMConf() { QString saveVLMConfFileName = QFileDialog::getSaveFileName( this, qtr( "Save VLM configuration as..." ), QVLCUserDir( VLC_DOCUMENTS_DIR ), qtr( "VLM conf (*.vlm);;All (*)" ) ); if( !saveVLMConfFileName.isEmpty() ) { vlm_message_t *message; QString command = "save \"" + saveVLMConfFileName + "\""; vlm_ExecuteCommand( p_vlm , qtu( command ) , &message ); vlm_MessageDelete( message ); return true; } return false; }
/** * Save the MetaData, triggered by parent->save Button **/ void MetaPanel::saveMeta() { if( p_input == NULL ) return; /* now we read the modified meta data */ input_item_SetTitle( p_input, qtu( title_text->text() ) ); input_item_SetArtist( p_input, qtu( artist_text->text() ) ); input_item_SetAlbum( p_input, qtu( collection_text->text() ) ); input_item_SetGenre( p_input, qtu( genre_text->text() ) ); input_item_SetTrackNum( p_input, qtu( seqnum_text->text() ) ); input_item_SetDate( p_input, qtu( date_text->text() ) ); input_item_SetCopyright( p_input, qtu( copyright_text->text() ) ); input_item_SetPublisher( p_input, qtu( publisher_text->text() ) ); input_item_SetDescription( p_input, qtu( description_text->text() ) ); playlist_t *p_playlist = pl_Get( p_intf ); input_item_WriteMeta( VLC_OBJECT(p_playlist), p_input ); /* Reset the status of the mode. No need to emit any signal because parent is the only caller */ b_inEditMode = false; }
void option( const QString& option, const QString& value = "" ) { if( !b_has_bracket ) mrl += "{"; else mrl += ","; b_has_bracket = true; mrl += option; if( !value.isEmpty() ) { char *psz = config_StringEscape( qtu(value) ); if( psz ) { mrl += "=" + qfu( psz ); free( psz ); } } }
void OpenDialog::stream( bool b_transcode_only ) { // QString soutMRL = getMRL( false ); // if( soutMRL.isEmpty() ) return; QStringList soutMRLS = getMRLs(false); if(soutMRLS.empty()) { return; } toggleVisible(); /* Dbg and send :D */ msg_Dbg( p_intf, "MRL(s) passed to the Sout: %i", soutMRLS.length() ); for(int i = 0; i < soutMRLS.length(); i++) { msg_Dbg( p_intf, "MRL(s) passed to the Sout: %s", qtu( soutMRLS[i] ) ); } THEDP->streamingDialog( this, soutMRLS, b_transcode_only, getOptions().split( " :" ) ); }
/** * Update/Create/Destroy a dialog **/ ExtensionDialog* ExtensionsDialogProvider::UpdateExtDialog( extension_dialog_t *p_dialog ) { assert( p_dialog ); ExtensionDialog *dialog = ( ExtensionDialog* ) p_dialog->p_sys_intf; if( p_dialog->b_kill && !dialog ) { /* This extension could not be activated properly but tried to create a dialog. We must ignore it. */ return NULL; } vlc_mutex_lock( &p_dialog->lock ); if( !p_dialog->b_kill && !dialog ) { dialog = CreateExtDialog( p_dialog ); dialog->setVisible( !p_dialog->b_hide ); dialog->has_lock = false; } else if( !p_dialog->b_kill && dialog ) { dialog->has_lock = true; dialog->UpdateWidgets(); if( strcmp( qtu( dialog->windowTitle() ), p_dialog->psz_title ) != 0 ) dialog->setWindowTitle( qfu( p_dialog->psz_title ) ); dialog->has_lock = false; dialog->setVisible( !p_dialog->b_hide ); } else if( p_dialog->b_kill ) { DestroyExtDialog( p_dialog ); } vlc_cond_signal( &p_dialog->cond ); vlc_mutex_unlock( &p_dialog->lock ); return dialog; }
void VLCMainwindow::StartPlayMainURL(QString rtspURL) { if( vlcPlayer && libvlc_media_player_is_playing(vlcPlayer) ) stop(); // New Media // libvlc_media_t *vlcMedia = libvlc_media_new_path(vlcObject,qtu(fileOpen)); libvlc_media_t *vlcMedia = libvlc_media_new_location(vlcObject,qtu(rtspURL)); if( !vlcMedia ) return; QMessageBox::warning(NULL, "Hello", "startPlayMainURL"); vlcPlayer = libvlc_media_player_new_from_media (vlcMedia); libvlc_media_release(vlcMedia); //libvlc_media_player_set_xwindow(vlcPlayer, windid); /* And play */ libvlc_media_player_play (vlcPlayer); //Set vars and text correctly playBut->setText("Pause"); }
void ConfigControl::doApply( intf_thread_t *p_intf ) { switch( getType() ) { case CONFIG_ITEM_INTEGER: case CONFIG_ITEM_BOOL: { VIntConfigControl *vicc = qobject_cast<VIntConfigControl *>(this); assert( vicc ); config_PutInt( p_intf, vicc->getName(), vicc->getValue() ); break; } case CONFIG_ITEM_FLOAT: { VFloatConfigControl *vfcc = qobject_cast<VFloatConfigControl *>(this); assert( vfcc ); config_PutFloat( p_intf, vfcc->getName(), vfcc->getValue() ); break; } case CONFIG_ITEM_STRING: { VStringConfigControl *vscc = qobject_cast<VStringConfigControl *>(this); assert( vscc ); config_PutPsz( p_intf, vscc->getName(), qtu( vscc->getValue() ) ); break; } case CONFIG_ITEM_KEY: { KeySelectorControl *ksc = qobject_cast<KeySelectorControl *>(this); assert( ksc ); ksc->doApply(); } } }
void VLMWrapper::ControlBroadcast( const QString& name, int BroadcastStatus, unsigned int seek ) { vlm_message_t *message; QString command = "control \"" + name + "\""; switch( BroadcastStatus ) { case ControlBroadcastPlay: command += " play"; break; case ControlBroadcastPause: command += " pause"; break; case ControlBroadcastStop: command += " stop"; break; case ControlBroadcastSeek: command += " seek" + seek; break; } vlm_ExecuteCommand( p_vlm, qtu( command ), &message ); vlm_MessageDelete( message ); }
void VLCMainwindow::StartPlay() { URLDialog = new OpenURLDialog; URLDialog->hide(); if( vlcPlayer && libvlc_media_player_is_playing(vlcPlayer) ) stop(); // New Media // libvlc_media_t *vlcMedia = libvlc_media_new_path(vlcObject,qtu(fileOpen)); libvlc_media_t *vlcMedia = libvlc_media_new_location(vlcObject,qtu (URLDialog->urlLineEdit->text())); if( !vlcMedia ) return; vlcPlayer = libvlc_media_player_new_from_media (vlcMedia); libvlc_media_release(vlcMedia); //libvlc_media_player_set_xwindow(vlcPlayer, windid); /* And play */ libvlc_media_player_play (vlcPlayer); //Set vars and text correctly playBut->setText("Pause"); }
void RecentsMRL::addRecent( const QString &mrl ) { if ( !isActive || ( filter && filter->indexIn( mrl ) >= 0 ) ) return; #ifdef _WIN32 /* Add to the Windows 7 default list in taskbar */ char* path = make_path( qtu( mrl ) ); if( path ) { wchar_t *wmrl = ToWide( path ); SHAddToRecentDocs( SHARD_PATHW, wmrl ); free( wmrl ); free( path ); } #endif int i_index = recents.indexOf( mrl ); if( 0 <= i_index ) { /* move to the front */ recents.move( i_index, 0 ); times.move( i_index, 0 ); } else { recents.prepend( mrl ); times.prepend( "-1" ); if( recents.count() > RECENTS_LIST_SIZE ) { recents.takeLast(); times.takeLast(); } } VLCMenuBar::updateRecents( p_intf ); save(); }
/* Generic open file */ void DialogsProvider::openFileGenericDialog( intf_dialog_args_t *p_arg ) { if( p_arg == NULL ) { msg_Warn( p_intf, "openFileGenericDialog() called with NULL arg" ); return; } /* Replace the extensions to a Qt format */ int i = 0; QString extensions = qfu( p_arg->psz_extensions ); while ( ( i = extensions.indexOf( "|", i ) ) != -1 ) { if( ( extensions.count( "|" ) % 2 ) == 0 ) extensions.replace( i, 1, ");;" ); else extensions.replace( i, 1, "(" ); } extensions.replace( ";*", " *" ); extensions.append( ")" ); /* Save */ if( p_arg->b_save ) { QString file = QFileDialog::getSaveFileName( NULL, qfu( p_arg->psz_title ), p_intf->p_sys->filepath, extensions ); if( !file.isEmpty() ) { p_arg->i_results = 1; p_arg->psz_results = (char **)malloc( p_arg->i_results * sizeof( char * ) ); p_arg->psz_results[0] = strdup( qtu( toNativeSepNoSlash( file ) ) ); } else p_arg->i_results = 0; } else /* non-save mode */ { QStringList files = QFileDialog::getOpenFileNames( NULL, qfu( p_arg->psz_title ), p_intf->p_sys->filepath, extensions ); p_arg->i_results = files.count(); p_arg->psz_results = (char **)malloc( p_arg->i_results * sizeof( char * ) ); i = 0; foreach( const QString &file, files ) p_arg->psz_results[i++] = strdup( qtu( toNativeSepNoSlash( file ) ) ); if(i == 0) p_intf->p_sys->filepath = QString::fromLatin1(""); else p_intf->p_sys->filepath = qfu( p_arg->psz_results[i-1] ); } /* Callback */ if( p_arg->pf_callback ) p_arg->pf_callback( p_arg ); /* Clean afterwards */ if( p_arg->psz_results ) { for( i = 0; i < p_arg->i_results; i++ ) free( p_arg->psz_results[i] ); free( p_arg->psz_results ); } free( p_arg->psz_title ); free( p_arg->psz_extensions ); free( p_arg ); }
static void *Thread( void *obj ) { intf_thread_t *p_intf = (intf_thread_t *)obj; MainInterface *p_mi; char vlc_name[] = "vlc"; /* for WM_CLASS */ #ifdef QT5_HAS_X11 char platform_parm[] = "-platform"; char platform_value[] = "xcb"; #endif char *argv[] = { vlc_name, #ifdef QT5_HAS_X11 platform_parm, platform_value, #endif NULL, }; int argc = sizeof(argv) / sizeof(argv[0]) - 1; Q_INIT_RESOURCE( vlc ); /* Start the QApplication here */ QVLCApp app( argc, argv ); p_intf->p_sys->p_app = &app; /* All the settings are in the .conf/.ini style */ p_intf->p_sys->mainSettings = new QSettings( #ifdef _WIN32 QSettings::IniFormat, #else QSettings::NativeFormat, #endif QSettings::UserScope, "vlc", "vlc-qt-interface" ); /* Icon setting, Mac uses icon from .icns */ #ifndef Q_OS_MAC if( QDate::currentDate().dayOfYear() >= QT_XMAS_JOKE_DAY && var_InheritBool( p_intf, "qt-icon-change" ) ) app.setWindowIcon( QIcon::fromTheme( "vlc-xmas", QIcon( ":/logo/vlc128-xmas.png" ) ) ); else app.setWindowIcon( QIcon::fromTheme( "vlc", QIcon( ":/logo/vlc256.png" ) ) ); #endif /* Initialize the Dialog Provider and the Main Input Manager */ DialogsProvider::getInstance( p_intf ); MainInputManager::getInstance( p_intf ); #ifdef UPDATE_CHECK /* Checking for VLC updates */ if( var_InheritBool( p_intf, "qt-updates-notif" ) && !var_InheritBool( p_intf, "qt-privacy-ask" ) ) { int interval = var_InheritInteger( p_intf, "qt-updates-days" ); if( QDate::currentDate() > getSettings()->value( "updatedate" ).toDate().addDays( interval ) ) { /* The constructor of the update Dialog will do the 1st request */ UpdateDialog::getInstance( p_intf ); getSettings()->setValue( "updatedate", QDate::currentDate() ); } } #endif /* Create the normal interface in non-DP mode */ if( !p_intf->p_sys->b_isDialogProvider ) { p_mi = new MainInterface( p_intf ); p_intf->p_sys->p_mi = p_mi; } else p_mi = NULL; /* Explain how to show a dialog :D */ p_intf->pf_show_dialog = ShowDialog; /* Check window type from the Qt platform back-end */ p_intf->p_sys->voutWindowType = VOUT_WINDOW_TYPE_INVALID; #if HAS_QT5 || defined (Q_WS_QPA) QString platform = app.platformName(); if( platform == qfu("xcb") ) p_intf->p_sys->voutWindowType = VOUT_WINDOW_TYPE_XID; else if( platform == qfu("windows") ) p_intf->p_sys->voutWindowType = VOUT_WINDOW_TYPE_HWND; else if( platform == qfu("cocoa" ) ) p_intf->p_sys->voutWindowType = VOUT_WINDOW_TYPE_NSOBJECT; else msg_Err( p_intf, "unknown Qt platform: %s", qtu(platform) ); #elif defined (Q_WS_X11) p_intf->p_sys->voutWindowType = VOUT_WINDOW_TYPE_XID; #elif defined (Q_WS_WIN) || defined (Q_WS_PM) p_intf->p_sys->voutWindowType = VOUT_WINDOW_TYPE_HWND; #elif defined (Q_WS_MAC) p_intf->p_sys->voutWindowType = VOUT_WINDOW_TYPE_NSOBJECT; #endif /* Tell the main LibVLC thread we are ready */ vlc_sem_post (&ready); #ifdef Q_OS_MAC /* We took over main thread, register and start here */ if( !p_intf->p_sys->b_isDialogProvider ) { RegisterIntf( p_intf ); playlist_Play( THEPL ); } #endif /* Last settings */ app.setQuitOnLastWindowClosed( false ); /* Retrieve last known path used in file browsing */ p_intf->p_sys->filepath = getSettings()->value( "filedialog-path", QVLCUserDir( VLC_HOME_DIR ) ).toString(); /* Loads and tries to apply the preferred QStyle */ QString s_style = getSettings()->value( "MainWindow/QtStyle", "" ).toString(); if( s_style.compare("") != 0 ) QApplication::setStyle( s_style ); /* Launch */ app.exec(); msg_Dbg( p_intf, "QApp exec() finished" ); if (p_mi != NULL) { QMutexLocker locker (&lock); active = false; p_intf->p_sys->p_mi = NULL; /* Destroy first the main interface because it is connected to some slots in the MainInputManager */ delete p_mi; } /* */ ExtensionsManager::killInstance(); AddonsManager::killInstance(); /* Destroy all remaining windows, because some are connected to some slots in the MainInputManager Settings must be destroyed after that. */ DialogsProvider::killInstance(); /* Delete the recentsMRL object before the configuration */ RecentsMRL::killInstance(); /* Save the path or delete if recent play are disabled */ if( var_InheritBool( p_intf, "qt-recentplay" ) ) getSettings()->setValue( "filedialog-path", p_intf->p_sys->filepath ); else getSettings()->remove( "filedialog-path" ); /* */ delete p_intf->p_sys->pl_model; /* Delete the configuration. Application has to be deleted after that. */ delete p_intf->p_sys->mainSettings; /* Destroy the MainInputManager */ MainInputManager::killInstance(); /* Delete the application automatically */ return NULL; }
void AddonsManager::findDesignatedAddon( QString uri ) { addons_manager_Gather( p_manager, qtu(uri) ); }
ExtensionDialog::~ExtensionDialog() { msg_Dbg( p_intf, "Deleting extension dialog '%s'", qtu(windowTitle()) ); }
void VLMWrapper::EditSchedule( const QString& name, const QString& input, const QString& inputOptions, const QString& output, QDateTime _schetime, QDateTime _schedate, int _scherepeatnumber, int _repeatDays, bool b_enabled, const QString& mux ) { vlm_message_t *message; QString command; if( !input.isEmpty() ) { command = "setup \"" + name + "\" input \"" + input + "\""; vlm_ExecuteCommand( p_vlm, qtu( command ), &message ); vlm_MessageDelete( message ); QStringList options = inputOptions.split( " :", QString::SkipEmptyParts ); for( int i = 0; i < options.count(); i++ ) { command = "setup \"" + name + "\" option \"" + options[i].trimmed() + "\""; vlm_ExecuteCommand( p_vlm, qtu( command ), &message ); vlm_MessageDelete( message ); } } if( !output.isEmpty() ) { command = "setup \"" + name + "\" output \"" + output + "\""; vlm_ExecuteCommand( p_vlm, qtu( command ), &message ); vlm_MessageDelete( message ); } if( b_enabled ) { command = "setup \"" + name + "\" enabled"; vlm_ExecuteCommand( p_vlm, qtu( command ), &message ); vlm_MessageDelete( message ); } if( !mux.isEmpty() ) { command = "setup \"" + name + "\" mux \"" + mux + "\""; vlm_ExecuteCommand( p_vlm, qtu( command ), &message ); vlm_MessageDelete( message ); } command = "setup \"" + name + "\" date \"" + _schedate.toString( "yyyy/MM/dd" )+ "-" + _schetime.toString( "hh:mm:ss" ) + "\""; vlm_ExecuteCommand( p_vlm, qtu( command ), &message ); vlm_MessageDelete( message ); if( _scherepeatnumber > 0 ) { command = "setup \"" + name + "\" repeat \"" + _scherepeatnumber + "\""; vlm_ExecuteCommand( p_vlm, qtu( command ), &message ); vlm_MessageDelete( message ); } if( _repeatDays > 0 ) { command = "setup \"" + name + "\" period \"" + _repeatDays + "\""; vlm_ExecuteCommand( p_vlm, qtu( command ), &message ); vlm_MessageDelete( message ); } }
QVLCVariable::~QVLCVariable (void) { var_DelCallback (object, qtu(name), callback, this); var_Destroy (object, qtu(name)); vlc_object_release (object); }
void VStringConfigControl::doApply() { config_PutPsz( p_this, getName(), qtu( getValue() ) ); }
bool MLModel::action( QAction *action, const QModelIndexList &indexes ) { actionsContainerType a = action->data().value<actionsContainerType>(); input_item_t *p_input; switch ( a.action ) { case ACTION_PLAY: if ( ! indexes.empty() && indexes.first().isValid() ) { activateItem( indexes.first() ); return true; } break; case ACTION_ADDTOPLAYLIST: foreach( const QModelIndex &index, indexes ) { if( !index.isValid() ) return false; AddItemToPlaylist( itemId( index, MLMEDIA_ID ), false, p_ml, true ); } return true; case ACTION_REMOVE: doDelete( indexes ); return true; case ACTION_SORT: break; case ACTION_CLEAR: removeAll(); return true; case ACTION_ENQUEUEFILE: foreach( const QString &uri, a.uris ) playlist_Add( THEPL, uri.toAscii().constData(), NULL, PLAYLIST_APPEND | PLAYLIST_PREPARSE, PLAYLIST_END, false, pl_Unlocked ); return true; case ACTION_ENQUEUEDIR: if( a.uris.isEmpty() ) return false; p_input = input_item_New( a.uris.first().toAscii().constData(), NULL ); if( unlikely( p_input == NULL ) ) return false; /* FIXME: playlist_AddInput() can fail */ playlist_AddInput( THEPL, p_input, PLAYLIST_APPEND, PLAYLIST_END, true, pl_Unlocked ); vlc_gc_decref( p_input ); return true; case ACTION_ENQUEUEGENERIC: foreach( const QString &uri, a.uris ) { p_input = input_item_New( qtu( uri ), NULL ); /* Insert options */ foreach( const QString &option, a.options.split( " :" ) ) { QString temp = colon_unescape( option ); if( !temp.isEmpty() ) input_item_AddOption( p_input, qtu( temp ), VLC_INPUT_OPTION_TRUSTED ); } /* FIXME: playlist_AddInput() can fail */ playlist_AddInput( THEPL, p_input, PLAYLIST_APPEND | PLAYLIST_PREPARSE, PLAYLIST_END, false, pl_Unlocked ); vlc_gc_decref( p_input ); } return true; default: break; } return false; }