227
232
if( CurTrack->m_Year )
228
233
FillMetadataDetails( &dict, metadata_names[ 9 ], ( const int ) CurTrack->m_Year );
230
// if( !CurTrack->m_CoverPath.IsEmpty() )
231
// FillMetadataDetails( &dict, metadata_names[ 10 ], ( const char * ) ( wxT( "file://" ) + CurTrack->m_CoverPath ).mb_str( wxConvUTF8 ) );
235
//if( !CurTrack->m_CoverPath.IsEmpty() )
236
// FillMetadataDetails( &dict, metadata_names[ 10 ], ( const char * ) ( wxT( "file://" ) + CurTrack->m_CoverPath ).mb_str( wxConvUTF8 ) );
233
238
if( CurTrack->m_Rating )
234
239
FillMetadataDetails( &dict, metadata_names[ 11 ], ( const int ) CurTrack->m_Bitrate );
686
696
DBusMessageIter args;
687
697
dbus_message_iter_init_append( reply->GetMessage(), &args );
689
//printf( "AddTrack: %s\n", TrackPath );
693
m_PlayerPanel->ClearPlayList();
695
if( m_PlayerPanel->GetState() != guMEDIASTATE_STOPPED )
697
wxCommandEvent event( wxEVT_COMMAND_MENU_SELECTED, ID_PLAYERPANEL_STOP );
698
wxPostEvent( m_PlayerPanel, event );
702
m_PlayerPanel->AddToPlayList( wxString( TrackPath, wxConvUTF8 ) );
706
wxCommandEvent event( wxEVT_COMMAND_MENU_SELECTED, ID_PLAYERPANEL_PLAY );
707
m_PlayerPanel->OnNextTrackButtonClick( event );
708
m_PlayerPanel->OnPlayButtonClick( event );
699
wxArrayString * TrackList = new wxArrayString();
700
TrackList->Add( wxString( TrackPath, wxConvUTF8 ) );
702
wxCommandEvent event( wxEVT_COMMAND_MENU_SELECTED, ID_PLAYERPANEL_ADDTRACKS );
703
event.SetInt( PlayTrack );
704
event.SetClientData( TrackList );
705
wxPostEvent( m_PlayerPanel, event );
708
if( !dbus_message_iter_append_basic( &args, DBUS_TYPE_INT32, &TrackAdded ) )
710
guLogError( wxT( "Failed to attach the AddTrack return code" ) );
715
RetVal = DBUS_HANDLER_RESULT_HANDLED;
718
else if( !strcmp( Member, "AddTracks" ) )
721
dbus_error_init( &error );
724
dbus_int32_t TracksCount;
725
dbus_bool_t PlayTrack;
727
dbus_message_get_args( msg->GetMessage(), &error,
728
DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &Tracks, &TracksCount,
729
DBUS_TYPE_BOOLEAN, &PlayTrack,
732
// //guLogMessage( wxT( "MPRIS: AddTrack\n%s\n%i" ), wxString( TrackPath, wxConvUTF8 ).c_str(), PlayTrack );
734
if( dbus_error_is_set( &error ) )
736
guLogMessage( wxT( "Could not read the AddTracks parameters : '%s'" ), wxString( error.message, wxConvUTF8 ).c_str() );
737
dbus_error_free( &error );
738
RetVal = DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
742
DBusMessageIter args;
743
dbus_message_iter_init_append( reply->GetMessage(), &args );
745
wxArrayString * TrackList = new wxArrayString();
747
for( Index = 0; Index < TracksCount; Index++ )
749
TrackList->Add( wxString( Tracks[ Index ], wxConvUTF8 ) );
752
wxCommandEvent event( wxEVT_COMMAND_MENU_SELECTED, ID_PLAYERPANEL_ADDTRACKS );
753
event.SetInt( PlayTrack );
754
event.SetClientData( TrackList );
755
wxPostEvent( m_PlayerPanel, event );
711
757
int TrackAdded = 1;
712
758
if( !dbus_message_iter_append_basic( &args, DBUS_TYPE_INT32, &TrackAdded ) )