Changeset 2e50966347e519ed46e448ffb66afe10d3a01cb0

Show
Ignore:
Timestamp:
07/04/06 23:52:33 (3 years ago)
Author:
Antoine Cellerier <dionoea@videolan.org>
git-committer:
Antoine Cellerier <dionoea@videolan.org> 1144446753 +0000
git-parent:

[35e982dd4bbae7e3b882e87ee0c61188eb7c5f04]

git-author:
Antoine Cellerier <dionoea@videolan.org> 1144446753 +0000
Message:

Win32 specific changes: Add --started-from-file option to tell VLC that it was started by clicking on a file (or disc). Add --one-instance-when-started-from-file option to tell VLC to use one instance mode when --started-from-file is used. See replies to r15125 for an explanation.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/libvlc.h

    rfb0afd8 r2e50966  
    831831    "double-click on a file in the explorer. This option will allow you " \ 
    832832    "to play the file with the already running instance or enqueue it.") 
     833 
     834#define STARTEDFROMFILE_TEXT N_("VLC is started from file association") 
     835#define STARTEDFROMFILE_LONGTEXT N_( \ 
     836    "Tell VLC that it is being launched due to a file association in the OS" ) 
     837 
     838#define ONEINSTANCEWHENSTARTEDFROMFILE_TEXT N_( \ 
     839    "Allow only on running instance when started from file") 
     840#define ONEINSTANCEWHENSTARTEDFROMFILE_LONGTEXT N_( \ 
     841    "Allow only on running instance when started from file") 
    833842 
    834843#define HPRIORITY_TEXT N_("Increase the priority of the process") 
     
    14651474    add_bool( "one-instance", 0, NULL, ONEINSTANCE_TEXT, 
    14661475              ONEINSTANCE_LONGTEXT, VLC_TRUE ); 
     1476    add_bool( "started-from-file", 0, NULL, STARTEDFROMFILE_TEXT, 
     1477              STARTEDFROMFILE_LONGTEXT, VLC_TRUE ); 
     1478    add_bool( "one-instance-when-started-from-file", 1, NULL, 
     1479              ONEINSTANCEWHENSTARTEDFROMFILE_TEXT, 
     1480              ONEINSTANCEWHENSTARTEDFROMFILE_LONGTEXT, VLC_TRUE ); 
    14671481    add_bool( "playlist-enqueue", 0, NULL, PLAYLISTENQUEUE_TEXT, 
    14681482              PLAYLISTENQUEUE_LONGTEXT, VLC_TRUE ); 
  • src/misc/win32_specific.c

    r75729ee r2e50966  
    150150    } 
    151151 
    152     if( config_GetInt( p_this, "one-instance" ) ) 
     152    if( config_GetInt( p_this, "one-instance" ) 
     153        || ( config_GetInt( p_this, "one-instance-when-started-from-file" ) 
     154             && config_GetInt( p_this, "started-from-file" ) ) ) 
    153155    { 
    154156        HANDLE hmutex; 
  • vlc.win32.nsi

    r540ddda r2e50966  
    174174  WriteRegStr HKCR "VLC$R0" "" "VLC media file" 
    175175  WriteRegStr HKCR "VLC$R0\shell" "" "Play" 
    176   WriteRegStr HKCR "VLC$R0\shell\Play\command" "" '"$INSTDIR\vlc.exe" "%1"' 
     176  WriteRegStr HKCR "VLC$R0\shell\Play\command" "" '"$INSTDIR\vlc.exe" --one-instance-when-started-from-file "%1"' 
    177177  WriteRegStr HKCR "VLC$R0\DefaultIcon" "" '"$INSTDIR\vlc.exe",0' 
    178178FunctionEnd 
     
    220220!macro AddContextMenu EXT 
    221221  WriteRegStr HKCR ${EXT}\shell\PlayWithVLC "" "Play with VLC media player" 
    222   WriteRegStr HKCR ${EXT}\shell\PlayWithVLC\command "" '$INSTDIR\vlc.exe --no-playlist-enqueue "%1"' 
     222  WriteRegStr HKCR ${EXT}\shell\PlayWithVLC\command "" '$INSTDIR\vlc.exe --one-instance-when-started-from-file --no-playlist-enqueue "%1"' 
    223223 
    224224  WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC "" "Add to VLC media player's Playlist" 
    225   WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC\command "" '$INSTDIR\vlc.exe --one-instance --playlist-enqueue "%1"' 
     225  WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC\command "" '$INSTDIR\vlc.exe --one-instance-when-started-from-file --playlist-enqueue "%1"' 
    226226!macroend 
    227227 
     
    279279  WriteRegStr HKCR Applications\vlc.exe\shell\Play "" "Play with VLC" 
    280280  WriteRegStr HKCR Applications\vlc.exe\shell\Play\command "" \ 
    281     '$INSTDIR\vlc.exe "%1"' 
     281    '$INSTDIR\vlc.exe --one-instance-when-started-from-file "%1"' 
    282282  !insertmacro MacroAllExtensions WriteRegStrSupportedTypes 
    283283 
    284284  WriteRegStr HKCR "AudioCD\shell\PlayWithVLC" "" "Play with VLC media player" 
    285285  WriteRegStr HKCR "AudioCD\shell\PlayWithVLC\command" "" \ 
    286     "$INSTDIR\vlc.exe cdda:%1" 
     286    "$INSTDIR\vlc.exe --one-instance-when-started-from-file cdda:%1" 
    287287  WriteRegStr HKCR "DVD\shell\PlayWithVLC" "" "Play with VLC media player" 
    288288  WriteRegStr HKCR "DVD\shell\PlayWithVLC\command" "" \ 
    289     "$INSTDIR\vlc.exe dvd:%1" 
     289    "$INSTDIR\vlc.exe --one-instance-when-started-from-file dvd:%1" 
    290290 
    291291  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival" "" 
     
    298298  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival" "" 
    299299  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Action" "Play CD audio" 
    300   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0' 
     300  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe --one-instance-when-started-from-file",0' 
    301301  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeProgID" "VLC.CDAudio" 
    302302  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeVerb" "play" 
     
    305305  WriteRegStr HKCR "VLC.DVDMovie\shell" "" "Play" 
    306306  WriteRegStr HKCR "VLC.DVDMovie\shell\Play\command" "" \ 
    307     '$INSTDIR\vlc.exe dvd:%1' 
     307    '$INSTDIR\vlc.exe --one-instance-when-started-from-file dvd:%1' 
    308308  WriteRegStr HKCR "VLC.DVDMovie\DefaultIcon" "" '"$INSTDIR\vlc.exe",0' 
    309309  WriteRegStr HKCR "VLC.CDAudio" "" "VLC CD Audio" 
    310310  WriteRegStr HKCR "VLC.CDAudio\shell" "" "Play" 
    311311  WriteRegStr HKCR "VLC.CDAudio\shell\Play\command" "" \ 
    312     '$INSTDIR\vlc.exe cdda:%1' 
     312    '$INSTDIR\vlc.exe --one-instance-when-started-from-file cdda:%1' 
    313313  WriteRegStr HKCR "VLC.CDAudio\DefaultIcon" "" '"$INSTDIR\vlc.exe",0' 
    314314