This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch gzng in repository mteleplayer. at 70dd645 mTP GUI: use gtk_window_present() instead of gtk_window_deiconify/_iconify. This is more reliable.~ This branch includes the following new commits: new 67a395b Changes to stuff that brings the window to the "front"/"top" when file is loaded... new aea9519 Merge branch 'master' of https://github.com/sunweaver/mteleplayer new 6741cba Test blackout of existing file while caching new file... new cb82132 Minor cleanup and adding more cache info handeling on both sides of the wormhole new 33e977b Minor cleanup of old junk we don't need... new d5bc284 Improves volume control new 979582b GUI and keyb control improvements + cleanups new 795e298 FileOpenerDialog Improved new 3f53483 Removing obsolete file new 8381ceb GFX Update new 1ae7e37 Minor test fix new 1b56518 Better GFX loading and handeling... new 7a4ba66 Media area GFX changes depending on state and media type. new d47ce41 Total rewrite of the overlay visibility and location handling + cleanup new b014e10 Test basic Id3v2 Album Art support audio files...(needs quite a bit more work) new 2fa1659 mTPAArtExtractor: Add license header. new ff58aea move libAArtExtractor to lib/ rather then bin/ new bb13be3 debian/control: Package mTPAArtExtractor in a separate bin:package new 12bdd2e typo fix new 860ff61 Adding some visibility test stuff new df83974 Adding some more visibility test stuff and maybe a FIX new d899ad0 minor gfx change new f44fbbb ... new 9bc734e . new 26a801f Fix dancing numbers and hopefully some olMagic visibility issues new 80c128d mteleplayer_clientside: Give the fullscreen going X2Go Agent window more time (1sec) to settle before raising the mplayer overlay again. new 52b6942 Relaxing some timeout limits to prevent premature selfdestruction on slow connections new deff486 Relaxing some timeout limits to prevent premature selfdestruction on slow connections new 70dd645 mTP GUI: use gtk_window_present() instead of gtk_window_deiconify/_iconify. This is more reliable.~ The 29 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/mteleplayer.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch gzng in repository mteleplayer. commit 67a395b6ac70c0b5c7264fd12afa3e6315b8a6bb Author: gznget <opensource@gznianguan.com> Date: Fri Jun 27 09:59:19 2014 +0200 Changes to stuff that brings the window to the "front"/"top" when file is loaded... --- serverside/bin/mteleplayer | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/serverside/bin/mteleplayer b/serverside/bin/mteleplayer index 94dbcbd..70cf9ec 100755 --- a/serverside/bin/mteleplayer +++ b/serverside/bin/mteleplayer @@ -484,7 +484,7 @@ sub handleTheLocalSocket { } elsif ($saneData =~ /^ENQUEUEDMEDIA\|([0-9a-zA-Z]{24,64})\|([A-Z]{3,4})\|.*$/) { # Do something here to add this to the playlist in the GUI.... # but for now we're just going to start playing the new file... - actOnEnqueuedMEDIA($1,$2); + actOnEnqueuedMEDIA($1,$2,1); } elsif ($saneData =~ /^CORE\|STATECHANGE\|([IRST]{1})\|([0-3]{1})\|([0-1]{1})\|$/) { if ($1 eq "S") { $sstatusi{'runState'} = "S"; @@ -670,14 +670,16 @@ sub checkDimPosNSend { sub actOnEnqueuedMEDIA { my $Type = $_[1]; if ($_[0] =~ /^([a-zA-Z0-9]{24,64})$/) { - my $file = $1; + my $file = $1; if ($Type eq "FILE") { $PlayerStatus{'currentMediaID'} = $file; $PlayerStatus{'currentMediaType'} = "FILE"; $PlayerStatus{'currentMediaSeek'} = 0; appCOM("MPCMD|PLAYMEDIA|$1|FILE|0|0|"); - $GTKS{'MainAppWindow'}->iconify; - $GTKS{'MainAppWindow'}->deiconify; + if ($_[2] eq 1) { + $GTKS{'MainAppWindow'}->iconify; + $GTKS{'MainAppWindow'}->deiconify; + } } } } @@ -967,7 +969,7 @@ sub crankFileChooser { if (-f $playThisFile) { my $isItLoaded = mtpTeKiRemoteFileSetup("FILE:$playThisFile","$X2GoTKSHome/remote/appData/mteleplayer\_$selfSID"); if ($isItLoaded ne 0) { - actOnEnqueuedMEDIA($isItLoaded,"FILE"); + actOnEnqueuedMEDIA($isItLoaded,"FILE",0); } } } -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/mteleplayer.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch gzng in repository mteleplayer. commit 6741cba01df36af5a47a04954135cccd2178c337 Author: gznget <opensource@gznianguan.com> Date: Sat Jun 28 08:21:19 2014 +0200 Test blackout of existing file while caching new file... --- .../mteleplayer/bin/mteleplayer_clientside | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/clientside/lib/telekinesis/client/applications/mteleplayer/bin/mteleplayer_clientside b/clientside/lib/telekinesis/client/applications/mteleplayer/bin/mteleplayer_clientside index 100d818..c972604 100755 --- a/clientside/lib/telekinesis/client/applications/mteleplayer/bin/mteleplayer_clientside +++ b/clientside/lib/telekinesis/client/applications/mteleplayer/bin/mteleplayer_clientside @@ -280,8 +280,9 @@ if ($1 =~ /^MPCMD\|PLAYMEDIA\|([0-9a-zA-Z]{24,64})\|([A-Z]{3,4})\|(\d*)\|(\d*)\| appDBugLog(" FILE:$theMediaFilePath"); if (-e $theMediaFilePath) { appDBugLog(" THAT FILE EXISTS!!"); - mpCMD("loadfile $theMediaFilePath");# Load into a paused state - mpCMD("pausing pause"); + mpCMD("loadfile $BlackoutFile");# just to get rid of the "old" file if there is one... + mpCMD("loadfile $theMediaFilePath"); + mpCMD("pausing pause");# Load into a paused state if ($StartSeek > 0) { mpCMD("seek $StartSeek 2"); } -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/mteleplayer.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch gzng in repository mteleplayer. commit cb82132d62a46f7bf91601e1f7f5ad0bba7eba9a Author: gznget <opensource@gznianguan.com> Date: Sat Jun 28 14:53:19 2014 +0200 Minor cleanup and adding more cache info handeling on both sides of the wormhole --- .../mteleplayer/bin/mteleplayer_clientside | 8 ++++-- serverside/bin/mteleplayer | 29 +++++++++++++++++--- 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/clientside/lib/telekinesis/client/applications/mteleplayer/bin/mteleplayer_clientside b/clientside/lib/telekinesis/client/applications/mteleplayer/bin/mteleplayer_clientside index c972604..561ef19 100755 --- a/clientside/lib/telekinesis/client/applications/mteleplayer/bin/mteleplayer_clientside +++ b/clientside/lib/telekinesis/client/applications/mteleplayer/bin/mteleplayer_clientside @@ -495,9 +495,11 @@ sub watch_mplayerOutput { $mpState{'mediaFileName'} = $1;# print "File: $1\n"; } elsif ($line =~ /^ANS\_LENGTH\=([\d\.]*)$/) { $mpState{'mediaLength'} = $1; - } elsif ($line =~ /=== FIRST LOOP ===$/) { - } elsif ($line =~ /=== MPLOOP NEW LOOP ===$/) { - appCOM("GIVEMEFIRSTMEDIATOINIT"); + } elsif ($line =~ /^Cache fill:([\ \d\.\%]*)\((\d*) bytes\)/) { + appDBugLog("Cache fill! [$1] [$2]"); + my $cacheP = $1;$cacheP =~ s/\ //g; + my $cacheB = $2;$cacheB =~ s/\D//g; + appCOM("CACHING|$cacheP|$cacheB|"); } elsif ($line =~ /===== PAUSE =====/) { doPauseStuff("pause"); } elsif (($line =~ /^A:/) or ($line =~ /^V:/)) { diff --git a/serverside/bin/mteleplayer b/serverside/bin/mteleplayer index 70cf9ec..d3174ea 100755 --- a/serverside/bin/mteleplayer +++ b/serverside/bin/mteleplayer @@ -74,7 +74,7 @@ our %PRESISTENT;$PRESISTENT{'AudioVolume'} = 50; our %sstatusi;$sstatusi{'sockState'} = 0;$sstatusi{'sockRetryCnt'} = 0;$sstatusi{'runState'} = "I";$sstatusi{'X2GoResized'} = 0; $sstatusi{'lastCOMtime'} = (time()+2);$sstatusi{'remoteInitCnt'} = 0; -my %PlayerStatus;$PlayerStatus{'timePos'} = 0;$PlayerStatus{'timeLength'} = 0;$PlayerStatus{'paused'} = 0;$PlayerStatus{'stoped'} = 0;$PlayerStatus{'muted'} = 0;$PlayerStatus{'volume'} = 100; +my %PlayerStatus;$PlayerStatus{'timePos'} = 0;$PlayerStatus{'timeLength'} = 0;$PlayerStatus{'paused'} = 0;$PlayerStatus{'stoped'} = 0;$PlayerStatus{'muted'} = 0;$PlayerStatus{'volume'} = 100;$PlayerStatus{'caching'} = 0; $PlayerStatus{'seekTimeLag'} = 0;$PlayerStatus{'initialMediaID'} = 0;$PlayerStatus{'fullscreen'} = 0; our ($UserName,$UserHome,$X2GoSID,$X2GoSesHome,$X2GoTKSHome,$TeKiLSockPath) = getBasicServersideInfo(); my $LocalSocket; @@ -204,8 +204,15 @@ sub initMainWindow { $GTKS{'mTPeyesoreIMG'} = Gtk2::Image->new_from_pixbuf(Gtk2::Gdk::Pixbuf->new_from_file ("$theSHAREDIR/eyesore_t.png")); $GTKS{'mTPeyesoreIMG'}->set_size_request(254,160); - - + #################################################################### + # Player status texts etc.. + $GTKS{'INFO'}{'PLYRSTAT'}{'EBOX'} = Gtk2::EventBox->new; + $GTKS{'INFO'}{'PLYRSTAT'}{'LABEL'} = Gtk2::Label->new("LABEL TEXT"); + $GTKS{'INFO'}{'PLYRSTAT'}{'EBOX'}->add($GTKS{'INFO'}{'PLYRSTAT'}{'LABEL'}); + $GTKS{'INFO'}{'PLYRSTAT'}{'EBOX'}->modify_bg('normal',Gtk2::Gdk::Color->new(0x0000, 0x0000, 0x0000)); + $GTKS{'INFO'}{'PLYRSTAT'}{'EBOX'}->modify_fg('normal',Gtk2::Gdk::Color->new(0xffff, 0xffff, 0xffff)); + # Player status texts etc.. + #################################################################### $mTPMainMediaEBOX = Gtk2::EventBox->new; $mTPMainMediaEBOX->set_size_request(400,300); $mTPMainMediaEBOX->modify_bg('normal',Gtk2::Gdk::Color->new(0x0000, 0x0000, 0x0000)); @@ -283,6 +290,7 @@ sub initMainWindow { # $GTKS{'CTRLS'}{'CONTROLSTRIP'}{'MainHBOX'}->show_all; $GTKS{'MainVBox'}->pack_start($mTPMainMediaEBOX,TRUE, TRUE, 0); + $GTKS{'MainVBox'}->pack_start($GTKS{'INFO'}{'PLYRSTAT'}{'EBOX'}, FALSE, FALSE, 0); $GTKS{'MainVBox'}->pack_start($GTKS{'CTRLS'}{'MAIN'}, FALSE, FALSE, 0); $GTKS{'CTRLS'}{'MainVBox'}->pack_start($MTime_HBox, FALSE, FALSE, 0); $GTKS{'CTRLS'}{'MainVBox'}->pack_start($GTKS{'CTRLS'}{'CONTROLSTRIP'}{'MainHBOX'},FALSE, FALSE, 2); @@ -292,7 +300,7 @@ sub initMainWindow { $GTKS{'MainAppWindow'}->signal_connect(event => \&handleMainWindowEvent); $GTKS{'MainAppWindow'}->show_all; - + $GTKS{'INFO'}{'PLYRSTAT'}{'EBOX'}->hide_all; } @@ -507,6 +515,15 @@ sub handleTheLocalSocket { toggleBLACKOUT(0); appCOM("SUP"); } + + if ($1 =~ /^CACHING\|([\d\.\%]*)\|.*/) { + $GTKS{'INFO'}{'PLYRSTAT'}{'LABEL'}->set_text("Caching Media: $1"); + if ($PlayerStatus{'caching'} ne 1) { + $PlayerStatus{'caching'} = 1; + $GTKS{'INFO'}{'PLYRSTAT'}{'EBOX'}->show_all; + } + + } if ($1 =~ /^PAUSED\|(\d)\|/) { if ($1 eq 0) {stateChangePAUSED(0);} @@ -515,6 +532,10 @@ sub handleTheLocalSocket { #appDBugLog("SD:$1:SD"); if ($1 =~ /^UPDATE\|TIME\|(\d*)\|(\d*)\|$/) { + if ($PlayerStatus{'caching'} eq 1) { + $PlayerStatus{'caching'} = 0; + $GTKS{'INFO'}{'PLYRSTAT'}{'EBOX'}->hide_all; + } doUpdateTimeLine($1,$2); $PlayerStatus{'currentMediaSeek'} = $1; toggleBLACKOUT(0); -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/mteleplayer.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch gzng in repository mteleplayer. commit 33e977b7bfda01c3d1bb81bd8e908f236bc4d73b Author: gznget <opensource@gznianguan.com> Date: Sun Jun 29 16:45:25 2014 +0200 Minor cleanup of old junk we don't need... --- .../mteleplayer/bin/mteleplayer_clientside | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/clientside/lib/telekinesis/client/applications/mteleplayer/bin/mteleplayer_clientside b/clientside/lib/telekinesis/client/applications/mteleplayer/bin/mteleplayer_clientside index 561ef19..3cf427a 100755 --- a/clientside/lib/telekinesis/client/applications/mteleplayer/bin/mteleplayer_clientside +++ b/clientside/lib/telekinesis/client/applications/mteleplayer/bin/mteleplayer_clientside @@ -116,12 +116,10 @@ $mpState{'volume'} = 0;# Change this to get from server side! $mpState{'osd'} = 0; $mpState{'LASTINPUT'} = "";$mpState{'prevSecond'} = 0; ###########################33 -# CHANGE THIS!!! -open(SRF,">$LocalAppDataDIR/stillrunning");print SRF time(),"\n";close(SRF);# CHANGE THIS!!! -# CHANGE THIS!!! + ########################## $sstatusi{'lastCOMtime'} = (time()+2); -$TnW{'timeoutRound'} = Glib::Timeout->add (1000, sub {open(SRF,">$LocalAppDataDIR/stillrunning");print SRF time(),"\n";close(SRF);appCOM("YO!");if ($sstatusi{'lastCOMtime'} < (time()-2)) {&doSelfTerminate;}1;}); +$TnW{'timeoutRound'} = Glib::Timeout->add (1000, sub {appCOM("YO!");if ($sstatusi{'lastCOMtime'} < (time()-2)) {&doSelfTerminate;}1;}); #$TnW{'overlaystatechange'} = Glib::Timeout->add (250, \&overlayStateChange); connectionPresistance(); Gtk2->init; @@ -571,7 +569,6 @@ sub doSelfTerminate { if ($TnW{'timeoutRound'}) { Glib::Source->remove($TnW{'timeoutRound'}); } - unlink("$LocalAppDataDIR/stillrunning"); $runSTATE = "T"; mpCMD("quit"); usleep(100000); -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/mteleplayer.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch gzng in repository mteleplayer. commit d5bc284529c4023d08ffda03446324d55d47171c Author: gznget <opensource@gznianguan.com> Date: Mon Jun 30 09:30:43 2014 +0200 Improves volume control --- serverside/bin/mteleplayer | 55 +++++++++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 24 deletions(-) diff --git a/serverside/bin/mteleplayer b/serverside/bin/mteleplayer index d3174ea..e529b89 100755 --- a/serverside/bin/mteleplayer +++ b/serverside/bin/mteleplayer @@ -824,15 +824,33 @@ sub setVolumeICON { } sub changeAudioVolume { - if ($GTKS{'CTRLS'}{'VolumeScaler'}{'HSCALE'}) { - my $ValueFromScaler = sprintf("%d",$GTKS{'CTRLS'}{'VolumeScaler'}{'HSCALE'}->get_value); - if (($ValueFromScaler >= 0) and ($ValueFromScaler <= 100)) { - $PRESISTENT{'AudioVolume'} = $ValueFromScaler; - appDBugLog("MANUAL VOLUME CHANGE ($PRESISTENT{'AudioVolume'})"); - setVolumeICON($PRESISTENT{'AudioVolume'},0); + if (($_[0] eq "down") or ($_[0] eq "up")) { + my $changeVolume; + if ($_[0] eq "down") { + $changeVolume = ($PRESISTENT{'AudioVolume'} - 5); + } elsif ($_[0] eq "up") { + $changeVolume = ($PRESISTENT{'AudioVolume'} + 5); + } + if ($changeVolume < 0) {$changeVolume = 0;} + if ($changeVolume > 100) {$changeVolume = 100;} + if ($changeVolume ne $PRESISTENT{'AudioVolume'}) { + $PRESISTENT{'AudioVolume'} = $changeVolume; appCOM("SET|AUDIOVOLUME|$PRESISTENT{'AudioVolume'}|"); + if ($GTKS{'CTRLS'}{'VolumeScaler'}{'HSCALE'}) { + $GTKS{'CTRLS'}{'VolumeScaler'}{'HSCALE'}->set_value($PRESISTENT{'AudioVolume'}); + } } - } + } else { + if ($GTKS{'CTRLS'}{'VolumeScaler'}{'HSCALE'}) { + my $ValueFromScaler = sprintf("%d",$GTKS{'CTRLS'}{'VolumeScaler'}{'HSCALE'}->get_value); + if (($ValueFromScaler >= 0) and ($ValueFromScaler <= 100)) { + $PRESISTENT{'AudioVolume'} = $ValueFromScaler; + appDBugLog("MANUAL VOLUME CHANGE ($PRESISTENT{'AudioVolume'})"); + setVolumeICON($PRESISTENT{'AudioVolume'},0); + appCOM("SET|AUDIOVOLUME|$PRESISTENT{'AudioVolume'}|"); + } + } + } } sub eventBtnClickPlayPause { @@ -884,27 +902,16 @@ sub keyPressHandler { my ($widget,$event)= @_; my %modMasks = getKeyModifiers($event->state()); my $keyVal = $event->keyval(); - appDBugLog("KEY: $key_nr\n"); + appDBugLog("KEY: $keyVal\n"); if (($keyVal eq 32) or ($keyVal eq 80) or ($keyVal eq 112) or ($keyVal eq 65299)) {# PLAY/PAUSE &eventBtnClickPlayPause; } elsif (($keyVal eq 70) or ($keyVal eq 102)) {# Fullscreen toggler &toggleFullScreen; - } -#elsif ($keyVal eq 65455) {# Audio Volume DOWN -# my $changeVolume = ($PRESISTENT{'AudioVolume'} - 5); -# if ($changeVolume < 0) {$changeVolume = 0;} -# if ($changeVolume ne $PRESISTENT{'AudioVolume'}) { -# $PRESISTENT{'AudioVolume'} = $changeVolume; -# &changeAudioVolume; -# } -# } elsif ($keyVal eq 65450) {# Audio Volume UP -# my $changeVolume = ($PRESISTENT{'AudioVolume'} + 5); -# if ($changeVolume > 100) {$changeVolume = 100;} -# if ($changeVolume ne $PRESISTENT{'AudioVolume'}) { -# $PRESISTENT{'AudioVolume'} = $changeVolume; -# &changeAudioVolume; -# } -# } + } elsif ($keyVal eq 65455) {# Audio Volume DOWN + changeAudioVolume("down"); + } elsif ($keyVal eq 65450) {# Audio Volume UP + changeAudioVolume("up"); + } return FALSE; } -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/mteleplayer.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch gzng in repository mteleplayer. commit 979582b0f55f70e4bec08156605b04b78bb3d426 Author: gznget <opensource@gznianguan.com> Date: Mon Jun 30 15:42:23 2014 +0200 GUI and keyb control improvements + cleanups --- .../mteleplayer/bin/mteleplayer_clientside | 143 ++++++++++++++++---- serverside/bin/mteleplayer | 16 +++ 2 files changed, 133 insertions(+), 26 deletions(-) diff --git a/clientside/lib/telekinesis/client/applications/mteleplayer/bin/mteleplayer_clientside b/clientside/lib/telekinesis/client/applications/mteleplayer/bin/mteleplayer_clientside index 3cf427a..1fadc8d 100755 --- a/clientside/lib/telekinesis/client/applications/mteleplayer/bin/mteleplayer_clientside +++ b/clientside/lib/telekinesis/client/applications/mteleplayer/bin/mteleplayer_clientside @@ -95,7 +95,6 @@ $ENV{'MPSLAVEFIFOPATH'} = $SlaveFIFO; $ENV{'MTPSES_LOCALDATA'} = $LocalAppDataDIR; $ENV{'MTPC_SHAREPATH'} = $theSHAREDIR; my $myHomeDir = $ENV{'MTPC_HOMEPATH'}; -my $BlackoutFile = "$theSHAREDIR/blk.mpg"; my $LocalSocket; @@ -110,13 +109,17 @@ if (-S $TeKiLSockPath) { $sstatusi{'runState'} = "R"; ##################################### ##################################### ##################################### ##################################### # The Main Gtk2 event loop -my %mpState;$mpState{'MediaERROR'} = 0;$mpState{'FakeFS'} = 0;$mpState{'mediaPos'} = 0; $mpState{'mediaLength'} = 3;$mpState{'paused'} = 0; +my %mpState;$mpState{'MediaERROR'} = 0;$mpState{'FakeFS'} = 0;$mpState{'mediaPos'} = 0; $mpState{'mediaLength'} = 0;$mpState{'paused'} = 0; +$mpState{'noshow'} = 1; $mpState{'mute'} = 0; $mpState{'volume'} = 0;# Change this to get from server side! $mpState{'osd'} = 0; $mpState{'LASTINPUT'} = "";$mpState{'prevSecond'} = 0; ###########################33 - +# INIT MEDIA INFO +my %MediaINFO; +setMediaInfo(0); +# INIT MEDIA INFO ########################## $sstatusi{'lastCOMtime'} = (time()+2); $TnW{'timeoutRound'} = Glib::Timeout->add (1000, sub {appCOM("YO!");if ($sstatusi{'lastCOMtime'} < (time()-2)) {&doSelfTerminate;}1;}); @@ -278,8 +281,12 @@ if ($1 =~ /^MPCMD\|PLAYMEDIA\|([0-9a-zA-Z]{24,64})\|([A-Z]{3,4})\|(\d*)\|(\d*)\| appDBugLog(" FILE:$theMediaFilePath"); if (-e $theMediaFilePath) { appDBugLog(" THAT FILE EXISTS!!"); - mpCMD("loadfile $BlackoutFile");# just to get rid of the "old" file if there is one... + setMediaInfo(0); + $mpState{'noshow'} = 1; + overlayStateChange(); mpCMD("loadfile $theMediaFilePath"); + if ($mpState{'FakeFS'} ne 1) {mpCMD("osd 0");} + mpCMD("volume $mpState{'volume'} 1"); mpCMD("pausing pause");# Load into a paused state if ($StartSeek > 0) { mpCMD("seek $StartSeek 2"); @@ -295,6 +302,8 @@ if ($1 =~ /^MPCMD\|PLAYMEDIA\|([0-9a-zA-Z]{24,64})\|([A-Z]{3,4})\|(\d*)\|(\d*)\| $window->resize($sstatusi{'FinalPosW'},$sstatusi{'FinalPosH'}); $window->move($sstatusi{'FinalPosX'},$sstatusi{'FinalPosY'}); overlayStateChange(); +} elsif ($1 =~ /^MPCMD\|FRAMESTEP\|/) { + mpCMD("frame_step"); } elsif ($1 =~ /^MPCMD\|PAUSE\|/) { mpCMD("pausing pause"); } elsif ($1 =~ /^MPCMD\|PLAY\|/) { @@ -304,6 +313,15 @@ if ($1 =~ /^MPCMD\|PLAYMEDIA\|([0-9a-zA-Z]{24,64})\|([A-Z]{3,4})\|(\d*)\|(\d*)\| if ($1 <= $mpState{'mediaLength'}) { mpCMD("seek $1 2"); } +} elsif ($1 =~ /^MPCMD\|KEYSEEK\|(\-?\d*)\|/) { + my $newPos = ($mpState{'mediaPos'}+$1); + if ($newPos < 0) {$newPos = 0;} + if ($newPos > ($mpState{'mediaLength'}-1)) { + mpCMD("pausing frame_step"); + inList2Play("next"); + } else { + mpCMD("seek $newPos 2"); + } } @@ -391,11 +409,18 @@ sub overlayStateChange { $newXPos{'W'} = $sstatusi{'xposW'}; $newXPos{'H'} = $sstatusi{'xposH'}; + if (($sstatusi{'X2GoWVisible'} eq 1) and ($sstatusi{'xposV'} eq 1)) { - $newXPos{'V'} = 1; + if ($mpState{'noshow'} eq 1) { + $newXPos{'V'} = 0; + } else { + $newXPos{'V'} = 1; + } } else { $newXPos{'V'} = 0; } + + if (($newXPos{'X'} ne $sstatusi{'FinalPosX'}) or ($newXPos{'Y'} ne $sstatusi{'FinalPosY'})) { $sstatusi{'FinalPosX'} = $newXPos{'X'}; $sstatusi{'FinalPosY'} = $newXPos{'Y'}; @@ -411,7 +436,7 @@ sub overlayStateChange { } - if ($newXPos{'V'} ne $sstatusi{'FinalPosV'}) { + if (($newXPos{'V'} ne $sstatusi{'FinalPosV'}) or ($mpState{'noshow'} eq 1)) { $sstatusi{'FinalPosV'} = $newXPos{'V'}; if ($newXPos{'V'} eq 1) { $window->show_all(); @@ -477,22 +502,47 @@ sub watch_mplayerOutput { $line =~ s/[\n\r\t]//g; ############### # Trigers... - if ($line =~ /^Starting playback\.\.\./) {# mpCMD("get_file_name"); - if ($mpState{'FakeFS'} ne 1) {mpCMD("osd 0");} - mpCMD("get_time_length"); - mpCMD("volume $mpState{'volume'} 1"); - if ($mpState{'notInitial'} ne 1) { - $mpState{'notInitial'} = 1; - appCOM("GIVEMEFIRSTMEDIATOINIT"); - } - } +# if ($line =~ /^Starting playback\.\.\./) {# mpCMD("get_file_name"); +# if ($mpState{'FakeFS'} ne 1) {mpCMD("osd 0");} +# mpCMD("get_time_length"); +# mpCMD("volume $mpState{'volume'} 1"); +# if ($mpState{'notInitial'} ne 1) { +# $mpState{'notInitial'} = 1; +# appCOM("GIVEMEFIRSTMEDIATOINIT"); +# } +# } # Triggers ############### # ANSWERS - if ($line =~ /^ANS\_FILENAME\=\'(.*)\'$/) { + if ($line =~ /^ID/) { + ############################# + # GET MEDIA INFO + if ($mediaINFO{'MEDIAINFOSET'} ne 1) { + if ($line =~ /^ID_VIDEO_FORMAT\=(.*)$/) { + $mediaINFO{'VIDEOFORMAT'} = $1; + } elsif ($line =~ /^ID_AUDIO_FORMAT\=(.*)$/) { + $mediaINFO{'AUDIOFORMAT'} = $1; + } elsif ($line =~ /^ID_LENGTH\=([\.\d]*)$/) { + $mediaINFO{'LENGHT'} = $1; + } elsif ($line =~ /^ID_SEEKABLE\=1$/) { + $mediaINFO{'SEEKABLE'} = 1; + } elsif ($line =~ /^ID_FILENAME\=(.*)$/) { + $mediaINFO{'FILENAME'} = $1; + } + } + # GET MEDIA INFO + ############################# + } elsif ($line =~ /^Playing(.*)$/) { + appDBugLog("SET X:$1:X"); + if ($1 =~ /mteleplayer\/blk\.mpg\.$/) {$mediaINFO{'AXEPTINFO'} = 0;} + else {$mediaINFO{'AXEPTINFO'} = 1;} + } elsif (($line =~ /======================================/) and ($mediaINFO{'MEDIAINFOSET'} ne 1)) { + appDBugLog("SET STATUS!"); + setMediaInfo(1);# Trigger setMediaInfo DONE... + } elsif ($line =~ /^ANS\_FILENAME\=\'(.*)\'$/) { $mpState{'mediaFileName'} = $1;# print "File: $1\n"; } elsif ($line =~ /^ANS\_LENGTH\=([\d\.]*)$/) { - $mpState{'mediaLength'} = $1; +# $mpState{'mediaLength'} = $1; } elsif ($line =~ /^Cache fill:([\ \d\.\%]*)\((\d*) bytes\)/) { appDBugLog("Cache fill! [$1] [$2]"); my $cacheP = $1;$cacheP =~ s/\ //g; @@ -510,24 +560,22 @@ sub watch_mplayerOutput { if ($newSecond ne $mpState{'prevSecond'}) { $mpState{'prevSecond'} = $newSecond; doReportTimePos($newSecond,$mpState{'mediaLength'}); - if ($mpState{'mediaLength'} > 1) { - if (($mpState{'mediaLength'} - 1) <= $mpState{'mediaPos'}) { + appDBugLog("MP: :$mpState{'mediaLength'}: :$mpState{'mediaPos'}:"); +# if ($mpState{'mediaLength'} > 0) { + if (($mpState{'mediaLength'}-1) <= $mpState{'mediaPos'}) { appDBugLog("LOADPOINT 1! $mpState{'mediaLength'} $mpState{'mediaPos'}"); mpCMD("pausing frame_step"); inList2Play("next"); } - } else { - appDBugLog("LOADPOINT 3!"); - mpCMD("pausing loadfile $BlackoutFile"); - } +# } } } elsif ($line =~ /^Failed to open LIRC support/) {#DO NOTHING!! } elsif (($line =~ /^Failed\ to\ open.*/) or ($line =~ /^File\ not\ found.*/)) { appDBugLog("NOT A FILE!\n $line"); - mpCMD("pausing loadfile $BlackoutFile"); +# Do something HERE? } elsif ($line =~ /^Failed\ to\ recognize\ file\ format.*/) { appDBugLog("NOT A MEDIA FILE!\n $line\n"); - mpCMD("pausing loadfile $BlackoutFile"); +# DO SOMETHING HERE? } else { appDBugLog("UNCUAGHT:\n $line\n"); } @@ -544,10 +592,53 @@ sub mpCMD { } - +sub setMediaInfo { + appDBugLog("SET setMediaINFO :$_[0]:"); + if ($_[0] eq 0) { + $mediaINFO{'AUDIOFORMAT'} = 0; + $mediaINFO{'VIDEOFORMAT'} = 0; + $mediaINFO{'LENGHT'} = 0; + $mediaINFO{'SEEKABLE'} = 0; + $mediaINFO{'FILENAME'} = 0; + $mediaINFO{'ONLYAUDIO'} = 0; + $mediaINFO{'MEDIAINFOSET'} = 0; + } elsif ($_[0] eq 1) { + appDBugLog("SET setMediaINFO STEP 1"); + foreach my $key (keys %mediaINFO) { + appDBugLog("SET\t$key $mediaINFO{$key}"); + } + unless ($mediaINFO{'FILENAME'} =~ /mteleplayer\/blk\.mpg$/) { + if ($mediaINFO{'VIDEOFORMAT'}) {$mediaINFO{'ONLYAUDIO'} = 1;} + $mpState{'mediaLength'} = $mediaINFO{'LENGHT'}; + if ($mediaINFO{'VIDEOFORMAT'} eq 0) { + $mpState{'noshow'} = 1; + } else { + $mpState{'noshow'} = 0; + } + + doReportTimePos("0.00",$mpState{'mediaLength'}); + $mediaINFO{'MEDIAINFOSET'} = 1; + } else { +# setMediaInfo(0); + } + overlayStateChange(); + } elsif ((uc($_[0]) =~ /^([A-Z]{3,})$/) and (length($_[1]) > 0)) { + $mediaINFO{$1} = $_[1]; + } +} # MPLAYER STUFF ###################################################################### +sub shouldWeBeVisible { + my $visible = 1; + if ($mpState{'noshow'} eq 1) {$visible = 0;} + + if ($visible eq 1) { + return 1; + } else { + return 0; + } +} sub windowEvent { my ($mw, $event) = @_; diff --git a/serverside/bin/mteleplayer b/serverside/bin/mteleplayer index e529b89..b69f01d 100755 --- a/serverside/bin/mteleplayer +++ b/serverside/bin/mteleplayer @@ -263,6 +263,7 @@ sub initMainWindow { $GTKS{'CTRLS'}{'VolumeScaler'}{'HSCALE'} = Gtk2::HScale->new($theVolAdj); $GTKS{'CTRLS'}{'VolumeScaler'}{'HSCALE'}->set_update_policy('continuous'); $GTKS{'CTRLS'}{'VolumeScaler'}{'HSCALE'}->set_digits(0); + $GTKS{'CTRLS'}{'VolumeScaler'}{'HSCALE'}->can_focus(0); $GTKS{'CTRLS'}{'VolumeScaler'}{'HSCALE'}->set_draw_value(FALSE); $GTKS{'CTRLS'}{'VolumeScaler'}{'HSCALE'}->set_value($PRESISTENT{'AudioVolume'}); $GTKS{'CTRLS'}{'VolumeScaler'}{'EBOX'}->add($GTKS{'CTRLS'}{'VolumeScaler'}{'HSCALE'}); @@ -359,6 +360,7 @@ sub seekTimeScaler { $GTKS{'seekTimeScaler'}->set_update_policy('discontinuous'); $GTKS{'seekTimeScaler'}->set_digits(0); $GTKS{'seekTimeScaler'}->set_draw_value(FALSE); + $GTKS{'seekTimeScaler'}->can_focus(0); $GTKS{'seekTimeScalerEBox'}->add($GTKS{'seekTimeScaler'}); $GTKS{'seekTimeScaler'}->show; } @@ -911,6 +913,20 @@ sub keyPressHandler { changeAudioVolume("down"); } elsif ($keyVal eq 65450) {# Audio Volume UP changeAudioVolume("up"); + } elsif ($keyVal eq 65363) {# SEEK +10s or frame step + if ($modMasks{'ctrl'}) { + appCOM("MPCMD|FRAMESTEP|"); + appDBugLog("FRAMESTEP"); + } else { + appDBugLog("KEYSEEK +10"); + appCOM("MPCMD|KEYSEEK|10|"); + } + } elsif ($keyVal eq 65361) {# SEEK -10s + appCOM("MPCMD|KEYSEEK|-10|"); + } elsif ($keyVal eq 65362) {# SEEK +60s + appCOM("MPCMD|KEYSEEK|60|"); + } elsif ($keyVal eq 65364) {# SEEK -60s + appCOM("MPCMD|KEYSEEK|-60|"); } return FALSE; } -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/mteleplayer.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch gzng in repository mteleplayer. commit aea9519240b9b2c32d94f23eb99cc6930cb18778 Merge: 67a395b e7fb124 Author: gznget <opensource@gznianguan.com> Date: Fri Jun 27 10:00:48 2014 +0200 Merge branch 'master' of https://github.com/sunweaver/mteleplayer debian/control | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/mteleplayer.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch gzng in repository mteleplayer. commit 1b56518ecbf265131f79642bedb3bd94c2accee4 Author: gznget <opensource@gznianguan.com> Date: Thu Jul 3 02:00:53 2014 +0200 Better GFX loading and handeling... --- serverside/bin/mteleplayer | 97 ++++++++++++-------- .../server/applications/mteleplayer/hourglass.png | Bin 0 -> 5994 bytes 2 files changed, 60 insertions(+), 37 deletions(-) diff --git a/serverside/bin/mteleplayer b/serverside/bin/mteleplayer index 293ad8e..fb455f7 100755 --- a/serverside/bin/mteleplayer +++ b/serverside/bin/mteleplayer @@ -201,11 +201,12 @@ sub initMainWindow { $GTKS{'CTRLS'}{'TOPMENU'}->add($GTKS{'MainAppWindow_topMenu'}->{widget}); $GTKS{'MainVBox'}->pack_start($GTKS{'CTRLS'}{'TOPMENU'}, FALSE, FALSE, 0); # my $pBuf = ; - $GTKS{'mTPsplashIMG'} = Gtk2::Image->new_from_pixbuf(Gtk2::Gdk::Pixbuf->new_from_file ("$theSHAREDIR/splash320.png")); - $GTKS{'mTPsplashIMG'}->set_size_request(320,240); - $GTKS{'mTPeyesoreIMG'} = Gtk2::Image->new_from_pixbuf(Gtk2::Gdk::Pixbuf->new_from_file ("$theSHAREDIR/eyesore_t.png")); - $GTKS{'mTPeyesoreIMG'}->set_size_request(254,160); + loadToPixBUF("mTPSplash","$theSHAREDIR/splash320.png"); + loadToPixBUF("hourGlass","$theSHAREDIR/hourglass.png"); + loadToPixBUF("musicalNote","$theSHAREDIR/musical_note.png"); + loadToPixBUF("eyesore","$theSHAREDIR/eyesore_t.png"); + $GTKS{'MainMediaEBOXGFX'} = Gtk2::Image->new_from_pixbuf($GTKS{'PixBUF'}{'mTPSplash'}); #################################################################### # Player status texts etc.. $GTKS{'INFO'}{'PLYRSTAT'}{'EBOX'} = Gtk2::EventBox->new; @@ -220,7 +221,7 @@ sub initMainWindow { $mTPMainMediaEBOX->modify_bg('normal',Gtk2::Gdk::Color->new(0x0000, 0x0000, 0x0000)); # $mTPMainMediaEBOX->add($GTKS{'mTPsplashIMG'}); - $mTPMainMediaEBOX->add($GTKS{'mTPeyesoreIMG'}); + $mTPMainMediaEBOX->add($GTKS{'MainMediaEBOXGFX'}); Gtk2::Rc->parse_string("gtk-primary-button-warps-slider = 1"); @@ -237,15 +238,17 @@ sub initMainWindow { $GTKS{'CTRLS'}{'MAIN'} = Gtk2::EventBox->new; $GTKS{'CTRLS'}{'MainVBox'} = Gtk2::VBox->new(FALSE, 0); $GTKS{'CTRLS'}{'MAIN'}->add($GTKS{'CTRLS'}{'MainVBox'}); + loadToPixBUF("ctrlsPlayBTN","$theSHAREDIR/gfx/default/play_btn_32.png"); + loadToPixBUF("ctrlsPauseBTN","$theSHAREDIR/gfx/default/pause_btn_32.png"); + loadToPixBUF("ctrlsPrevTrBTN","$theSHAREDIR/gfx/default/prevtr_btn_32.png"); + loadToPixBUF("ctrlsNextTrBTN","$theSHAREDIR/gfx/default/nexttr_btn_32.png"); $GTKS{'CTRLS'}{'BtnPlayPauseEBOX'} = Gtk2::EventBox->new; $GTKS{'CTRLS'}{'BtnPlayPauseEBOX'}->set_size_request(32,32); - $GTKS{'CTRLS'}{'BtnPlayPauseEBOX'}{'PlayGFX'} = Gtk2::Image->new_from_pixbuf(Gtk2::Gdk::Pixbuf->new_from_file ("$theSHAREDIR/gfx/default/play_btn_32.png")); - $GTKS{'CTRLS'}{'BtnPlayPauseEBOX'}{'PlayGFX'}->set_size_request(32,32); - $GTKS{'CTRLS'}{'BtnPlayPauseEBOX'}{'PauseGFX'} = Gtk2::Image->new_from_pixbuf(Gtk2::Gdk::Pixbuf->new_from_file ("$theSHAREDIR/gfx/default/pause_btn_32.png")); - $GTKS{'CTRLS'}{'BtnPlayPauseEBOX'}{'PauseGFX'}->set_size_request(32,32); + $GTKS{'CTRLS'}{'BtnPlayPauseEBOX'}{'GFX'} = Gtk2::Image->new_from_pixbuf($GTKS{'PixBUF'}{'ctrlsPlayBTN'}); + $GTKS{'CTRLS'}{'BtnPlayPauseEBOX'}->signal_connect('button-release-event' => \&eventBtnClickPlayPause); - $GTKS{'CTRLS'}{'BtnPlayPauseEBOX'}->add($GTKS{'CTRLS'}{'BtnPlayPauseEBOX'}{'PlayGFX'}); + $GTKS{'CTRLS'}{'BtnPlayPauseEBOX'}->add($GTKS{'CTRLS'}{'BtnPlayPauseEBOX'}{'GFX'}); stateChangePAUSED(0);# Use this to initiate the play/pause button gfx... $GTKS{'CTRLS'}{'BtnPreviousEBOX'} = Gtk2::EventBox->new;$GTKS{'CTRLS'}{'BtnPreviousEBOX'}->set_size_request(32,32); @@ -521,9 +524,10 @@ sub handleTheLocalSocket { } if ($1 =~ /^CACHING\|([\d\.\%]*)\|.*/) { - $GTKS{'INFO'}{'PLYRSTAT'}{'LABEL'}->set_text("Caching Media: $1"); + $GTKS{'INFO'}{'PLYRSTAT'}{'LABEL'}->set_text("Caching Media: $1%"); if ($PlayerStatus{'caching'} ne 1) { $PlayerStatus{'caching'} = 1; + $GTKS{'MainMediaEBOXGFX'}->set_from_pixbuf($GTKS{'PixBUF'}{'hourGlass'}); $GTKS{'INFO'}{'PLYRSTAT'}{'EBOX'}->show_all; } @@ -539,6 +543,7 @@ sub handleTheLocalSocket { if ($PlayerStatus{'caching'} eq 1) { $PlayerStatus{'caching'} = 0; $GTKS{'INFO'}{'PLYRSTAT'}{'EBOX'}->hide_all; + $GTKS{'MainMediaEBOXGFX'}->set_from_pixbuf($GTKS{'PixBUF'}{'eyesore'}); } doUpdateTimeLine($1,$2); $PlayerStatus{'currentMediaSeek'} = $1; @@ -706,6 +711,7 @@ sub actOnEnqueuedMEDIA { $GTKS{'MainAppWindow'}->deiconify; } } + $GTKS{'MainMediaEBOXGFX'}->set_from_pixbuf($GTKS{'PixBUF'}{'eyesore'}); } } @@ -801,30 +807,30 @@ sub doLocalQuickie { # various GUI event stuff.... sub setVolumeICON { my $volume = sanitizer("anumazlc",$_[0]); - my $icon; + my $icon = 0; if ($_[1] =~ /initGFX/) { - $GTKS{'CTRLS'}{'VolumeScaler'}{'IconBtn'}{'GFXM'} = Gtk2::Image->new_from_pixbuf(Gtk2::Gdk::Pixbuf->new_from_file("$theSHAREDIR/gfx/default/audio_vol_m_32.png"));$GTKS{'CTRLS'}{'VolumeScaler'}{'IconBtn'}{'GFXM'}->set_size_request(32,32); - $GTKS{'CTRLS'}{'VolumeScaler'}{'IconBtn'}{'GFX20'} = Gtk2::Image->new_from_pixbuf(Gtk2::Gdk::Pixbuf->new_from_file("$theSHAREDIR/gfx/default/audio_vol_20_32.png"));$GTKS{'CTRLS'}{'VolumeScaler'}{'IconBtn'}{'GFX20'}->set_size_request(32,32); - $GTKS{'CTRLS'}{'VolumeScaler'}{'IconBtn'}{'GFX40'} = Gtk2::Image->new_from_pixbuf(Gtk2::Gdk::Pixbuf->new_from_file("$theSHAREDIR/gfx/default/audio_vol_40_32.png"));$GTKS{'CTRLS'}{'VolumeScaler'}{'IconBtn'}{'GFX40'}->set_size_request(32,32); - $GTKS{'CTRLS'}{'VolumeScaler'}{'IconBtn'}{'GFX60'} = Gtk2::Image->new_from_pixbuf(Gtk2::Gdk::Pixbuf->new_from_file("$theSHAREDIR/gfx/default/audio_vol_60_32.png"));$GTKS{'CTRLS'}{'VolumeScaler'}{'IconBtn'}{'GFX60'}->set_size_request(32,32); - $GTKS{'CTRLS'}{'VolumeScaler'}{'IconBtn'}{'GFX80'} = Gtk2::Image->new_from_pixbuf(Gtk2::Gdk::Pixbuf->new_from_file("$theSHAREDIR/gfx/default/audio_vol_80_32.png"));$GTKS{'CTRLS'}{'VolumeScaler'}{'IconBtn'}{'GFX80'}->set_size_request(32,32); - $GTKS{'CTRLS'}{'VolumeScaler'}{'IconBtn'}{'GFX100'} = Gtk2::Image->new_from_pixbuf(Gtk2::Gdk::Pixbuf->new_from_file("$theSHAREDIR/gfx/default/audio_vol_100_32.png"));$GTKS{'CTRLS'}{'VolumeScaler'}{'IconBtn'}{'GFX100'}->set_size_request(32,32); + loadToPixBUF("ctrlsVolumeIconM","$theSHAREDIR/gfx/default/audio_vol_m_32.png"); + loadToPixBUF("ctrlsVolumeIcon20","$theSHAREDIR/gfx/default/audio_vol_20_32.png"); + loadToPixBUF("ctrlsVolumeIcon40","$theSHAREDIR/gfx/default/audio_vol_40_32.png"); + loadToPixBUF("ctrlsVolumeIcon60","$theSHAREDIR/gfx/default/audio_vol_60_32.png"); + loadToPixBUF("ctrlsVolumeIcon80","$theSHAREDIR/gfx/default/audio_vol_80_32.png"); + loadToPixBUF("ctrlsVolumeIcon100","$theSHAREDIR/gfx/default/audio_vol_100_32.png"); + + $GTKS{'CTRLS'}{'VolumeScaler'}{'IconBtn'}{'GFX'} = Gtk2::Image->new_from_pixbuf($GTKS{'PixBUF'}{'ctrlsVolumeIconM'}); + $GTKS{'CTRLS'}{'VolumeScaler'}{'IconBtn'}{'GFX'}->set_size_request(32,32); + $GTKS{'CTRLS'}{'VolumeScaler'}{'IconBtn'}{'EBOX'}->add($GTKS{'CTRLS'}{'VolumeScaler'}{'IconBtn'}{'GFX'}); } - if (($volume eq 0) or ($volume eq "m")) {$icon = "GFXM";} - elsif ($volume <= 20) {$icon = "GFX20";} - elsif ($volume <= 40) {$icon = "GFX40";} - elsif ($volume <= 60) {$icon = "GFX60";} - elsif ($volume <= 80) {$icon = "GFX80";} - elsif ($volume eq 100) {$icon = "GFX100";} + if (($volume eq 0) or ($volume eq "m")) {$icon = "M";} + elsif ($volume <= 20) {$icon = "20";} + elsif ($volume <= 40) {$icon = "40";} + elsif ($volume <= 60) {$icon = "60";} + elsif ($volume <= 80) {$icon = "80";} + elsif ($volume eq 100) {$icon = "100";} else {appDBugLog("Something is wrong with the '$volume' value in setVolumeICON!");} - if ($icon =~ /GFX/) { - if ($GTKS{'CTRLS'}{'VolumeScaler'}{'IconBtn'}{'CURRENT'} =~ /GFX/) { - $GTKS{'CTRLS'}{'VolumeScaler'}{'IconBtn'}{'EBOX'}->remove($GTKS{'CTRLS'}{'VolumeScaler'}{'IconBtn'}{$GTKS{'CTRLS'}{'VolumeScaler'}{'IconBtn'}{'CURRENT'}}); - } - $GTKS{'CTRLS'}{'VolumeScaler'}{'IconBtn'}{'CURRENT'} = $icon; - $GTKS{'CTRLS'}{'VolumeScaler'}{'IconBtn'}{'EBOX'}->add($GTKS{'CTRLS'}{'VolumeScaler'}{'IconBtn'}{$icon}); - $GTKS{'CTRLS'}{'VolumeScaler'}{'IconBtn'}{'EBOX'}->show_all; + if (($icon ne 0) and $GTKS{'CTRLS'}{'VolumeScaler'}{'IconBtn'}{'GFX'}) { + $GTKS{'CTRLS'}{'VolumeScaler'}{'IconBtn'}{'GFX'}->set_from_pixbuf($GTKS{'PixBUF'}{"ctrlsVolumeIcon$icon"}); } + } sub changeAudioVolume { @@ -872,14 +878,10 @@ sub eventBtnClickPlayPause { sub stateChangePAUSED { if ($_[0] eq 0) { $PlayerStatus{'paused'} = 0; - $GTKS{'CTRLS'}{'BtnPlayPauseEBOX'}->remove($GTKS{'CTRLS'}{'BtnPlayPauseEBOX'}{'PlayGFX'}); - $GTKS{'CTRLS'}{'BtnPlayPauseEBOX'}->add($GTKS{'CTRLS'}{'BtnPlayPauseEBOX'}{'PauseGFX'}); -$GTKS{'CTRLS'}{'BtnPlayPauseEBOX'}->show_all; + $GTKS{'CTRLS'}{'BtnPlayPauseEBOX'}{'GFX'}->set_from_pixbuf($GTKS{'PixBUF'}{'ctrlsPauseBTN'}); } elsif ($_[0] eq 1) { $PlayerStatus{'paused'} = 1; - $GTKS{'CTRLS'}{'BtnPlayPauseEBOX'}->remove($GTKS{'CTRLS'}{'BtnPlayPauseEBOX'}{'PauseGFX'}); - $GTKS{'CTRLS'}{'BtnPlayPauseEBOX'}->add($GTKS{'CTRLS'}{'BtnPlayPauseEBOX'}{'PlayGFX'}); -$GTKS{'CTRLS'}{'BtnPlayPauseEBOX'}->show_all; + $GTKS{'CTRLS'}{'BtnPlayPauseEBOX'}{'GFX'}->set_from_pixbuf($GTKS{'PixBUF'}{'ctrlsPlayBTN'}); } } @@ -948,6 +950,27 @@ sub getKeyModifiers { return %mask; } + +################################################################################################################################# +# Load PixBUF +sub loadToPixBUF { + my $pixName = sanitizer("anumazcsdaus",$_[0]); + my $pixPath = sanitizeFilePath($_[1]); + if ((-f $pixPath) and ($pixName)) { + $GTKS{'PixBUF'}{$pixName} = Gtk2::Gdk::Pixbuf->new_from_file ($pixPath) or appDBugLog("Unable to load $pixPath to PixBUF... Is it even a GFX file?"); + if ($GTKS{'PixBUF'}{$pixName}) { + appDBugLog("Loaded $pixPath to PixBUF..."); + return 1; + } else { + appDBugLog("Unable to load $pixPath to PixBUF..."); + return 0; + } + } else { + appDBugLog("Unable to load $pixPath to PixBUF..."); + return 0; + } +} + ################################################################################################################################# # Just a sub to tuck away the menu tree somewhere in a tidy fassion.... sub theMenuTreeSUB { diff --git a/serverside/share/telekinesis/server/applications/mteleplayer/hourglass.png b/serverside/share/telekinesis/server/applications/mteleplayer/hourglass.png new file mode 100644 index 0000000..90c84bf Binary files /dev/null and b/serverside/share/telekinesis/server/applications/mteleplayer/hourglass.png differ -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/mteleplayer.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch gzng in repository mteleplayer. commit 795e298a2ca5b2d2b7c444fcbf1b9dab37b76082 Author: gznget <opensource@gznianguan.com> Date: Mon Jun 30 16:34:31 2014 +0200 FileOpenerDialog Improved --- serverside/bin/mteleplayer | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/serverside/bin/mteleplayer b/serverside/bin/mteleplayer index b69f01d..293ad8e 100755 --- a/serverside/bin/mteleplayer +++ b/serverside/bin/mteleplayer @@ -43,6 +43,7 @@ our $APPDNAME = "mTelePlayer"; our $WINDOWTITLE = "mTelePlayer"; our $APPVER = "0.0.3.0"; use File::Spec; +use File::Basename; use Glib qw/TRUE FALSE/; use IO::Socket::UNIX qw( SOCK_STREAM ); use Time::HiRes qw( usleep gettimeofday tv_interval clock_gettime clock_getres clock_nanosleep clock stat ); @@ -76,6 +77,7 @@ our %sstatusi;$sstatusi{'sockState'} = 0;$sstatusi{'sockRetryCnt'} = 0;$sstatusi $sstatusi{'lastCOMtime'} = (time()+2);$sstatusi{'remoteInitCnt'} = 0; my %PlayerStatus;$PlayerStatus{'timePos'} = 0;$PlayerStatus{'timeLength'} = 0;$PlayerStatus{'paused'} = 0;$PlayerStatus{'stoped'} = 0;$PlayerStatus{'muted'} = 0;$PlayerStatus{'volume'} = 100;$PlayerStatus{'caching'} = 0; $PlayerStatus{'seekTimeLag'} = 0;$PlayerStatus{'initialMediaID'} = 0;$PlayerStatus{'fullscreen'} = 0; + $PlayerStatus{'theOpenerDir'} = setOpenerDir(0); our ($UserName,$UserHome,$X2GoSID,$X2GoSesHome,$X2GoTKSHome,$TeKiLSockPath) = getBasicServersideInfo(); my $LocalSocket; my $mTPMainMediaEBOX; @@ -1008,11 +1010,13 @@ sub crankFileChooser { $fileFilter->add_mime_type("video/*"); my $theFileChooser = Gtk2::FileChooserDialog->new ('Open media file...', undef, 'open', 'gtk-cancel' => 'cancel', 'gtk-ok' => 'ok'); $theFileChooser->add_filter($fileFilter); + $theFileChooser->set_current_folder($PlayerStatus{'theOpenerDir'}); if ($theFileChooser->run eq 'ok') { my $playThisFile = $theFileChooser->get_filename; if (-f $playThisFile) { my $isItLoaded = mtpTeKiRemoteFileSetup("FILE:$playThisFile","$X2GoTKSHome/remote/appData/mteleplayer\_$selfSID"); if ($isItLoaded ne 0) { + setOpenerDir($playThisFile); actOnEnqueuedMEDIA($isItLoaded,"FILE",0); } } @@ -1020,6 +1024,19 @@ sub crankFileChooser { $theFileChooser->destroy; } +sub setOpenerDir { + if ($_[0] eq 0) { + my $TheDIR = sanitizeDirPath($ENV{'PWD'}); + unless (-d $TheDIR) {$TheDIR = $UserHome;} + unless (-d $TheDIR) {$TheDIR = "";} + $PlayerStatus{'theOpenerDir'} = $TheDIR; + } else { + my $TheDIR = sanitizeDirPath(dirname(File::Spec->rel2abs($_[0]))); + if (-d $TheDIR) { + $PlayerStatus{'theOpenerDir'} = $TheDIR; + } + } +} ######################################################################################################## # GET Media FILE Info # Initially we we're using another perl module for this but it turned out to have some (b) ithchy dependencies on some never distros so... -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/mteleplayer.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch gzng in repository mteleplayer. commit 3f5348305ab25dfabc15f6677644a399b5f4fdd2 Author: gznget <opensource@gznianguan.com> Date: Tue Jul 1 21:14:09 2014 +0200 Removing obsolete file --- .../client/applications/mteleplayer/blk.mpg | Bin 45056 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/clientside/share/telekinesis/client/applications/mteleplayer/.placeholder b/clientside/share/telekinesis/client/applications/mteleplayer/.placeholder new file mode 100644 index 0000000..e69de29 diff --git a/clientside/share/telekinesis/client/applications/mteleplayer/blk.mpg b/clientside/share/telekinesis/client/applications/mteleplayer/blk.mpg deleted file mode 100644 index f0c59c4..0000000 Binary files a/clientside/share/telekinesis/client/applications/mteleplayer/blk.mpg and /dev/null differ -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/mteleplayer.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch gzng in repository mteleplayer. commit 8381ceb82c96f5d8996786e08106976631a0e47c Author: gznget <opensource@gznianguan.com> Date: Wed Jul 2 20:59:43 2014 +0200 GFX Update --- .../applications/mteleplayer/musical_note.png | Bin 0 -> 3255 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/serverside/share/telekinesis/server/applications/mteleplayer/musical_note.png b/serverside/share/telekinesis/server/applications/mteleplayer/musical_note.png new file mode 100644 index 0000000..3076a2e Binary files /dev/null and b/serverside/share/telekinesis/server/applications/mteleplayer/musical_note.png differ -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/mteleplayer.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch gzng in repository mteleplayer. commit 1ae7e3703c05ae2e7cb45492ad113a8fe0407df9 Author: gznget <opensource@gznianguan.com> Date: Wed Jul 2 22:27:09 2014 +0200 Minor test fix --- .../mteleplayer/bin/mteleplayer_clientside | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clientside/lib/telekinesis/client/applications/mteleplayer/bin/mteleplayer_clientside b/clientside/lib/telekinesis/client/applications/mteleplayer/bin/mteleplayer_clientside index 1fadc8d..3486e84 100755 --- a/clientside/lib/telekinesis/client/applications/mteleplayer/bin/mteleplayer_clientside +++ b/clientside/lib/telekinesis/client/applications/mteleplayer/bin/mteleplayer_clientside @@ -561,13 +561,13 @@ sub watch_mplayerOutput { $mpState{'prevSecond'} = $newSecond; doReportTimePos($newSecond,$mpState{'mediaLength'}); appDBugLog("MP: :$mpState{'mediaLength'}: :$mpState{'mediaPos'}:"); -# if ($mpState{'mediaLength'} > 0) { + if ($mpState{'mediaLength'} > 0) { if (($mpState{'mediaLength'}-1) <= $mpState{'mediaPos'}) { appDBugLog("LOADPOINT 1! $mpState{'mediaLength'} $mpState{'mediaPos'}"); mpCMD("pausing frame_step"); inList2Play("next"); } -# } + } } } elsif ($line =~ /^Failed to open LIRC support/) {#DO NOTHING!! } elsif (($line =~ /^Failed\ to\ open.*/) or ($line =~ /^File\ not\ found.*/)) { -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/mteleplayer.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch gzng in repository mteleplayer. commit 7a4ba66793ea5e220d6b21d1729ba884d9677225 Author: gznget <opensource@gznianguan.com> Date: Thu Jul 3 02:31:13 2014 +0200 Media area GFX changes depending on state and media type. --- .../mteleplayer/bin/mteleplayer_clientside | 36 +++++++++----------- serverside/bin/mteleplayer | 14 ++++++-- 2 files changed, 29 insertions(+), 21 deletions(-) diff --git a/clientside/lib/telekinesis/client/applications/mteleplayer/bin/mteleplayer_clientside b/clientside/lib/telekinesis/client/applications/mteleplayer/bin/mteleplayer_clientside index 3486e84..8594ee0 100755 --- a/clientside/lib/telekinesis/client/applications/mteleplayer/bin/mteleplayer_clientside +++ b/clientside/lib/telekinesis/client/applications/mteleplayer/bin/mteleplayer_clientside @@ -325,11 +325,11 @@ if ($1 =~ /^MPCMD\|PLAYMEDIA\|([0-9a-zA-Z]{24,64})\|([A-Z]{3,4})\|(\d*)\|(\d*)\| } -if ($1 =~ /^MPCMD\|STOP\|/) { - mpCMD("pausing loadfile $theSHAREDIR/blk.mpg"); - mpCMD("pause"); - $window->hide_all(); -} +#if ($1 =~ /^MPCMD\|STOP\|/) { +# mpCMD("pausing loadfile $theSHAREDIR/blk.mpg"); +# mpCMD("pause"); +# $window->hide_all(); +#} } elsif ($saneData =~ /^CORE\|SERVICES\|X2GOWINDOWSTATE\|(\d)\|(\d)\|(\d*)\|(\d*)\|(\d*)\|(\d*)\|/) { #print "CORE CHANGE $1\n"; my $retogglevis = 0; @@ -534,8 +534,6 @@ sub watch_mplayerOutput { ############################# } elsif ($line =~ /^Playing(.*)$/) { appDBugLog("SET X:$1:X"); - if ($1 =~ /mteleplayer\/blk\.mpg\.$/) {$mediaINFO{'AXEPTINFO'} = 0;} - else {$mediaINFO{'AXEPTINFO'} = 1;} } elsif (($line =~ /======================================/) and ($mediaINFO{'MEDIAINFOSET'} ne 1)) { appDBugLog("SET STATUS!"); setMediaInfo(1);# Trigger setMediaInfo DONE... @@ -603,24 +601,24 @@ sub setMediaInfo { $mediaINFO{'ONLYAUDIO'} = 0; $mediaINFO{'MEDIAINFOSET'} = 0; } elsif ($_[0] eq 1) { - appDBugLog("SET setMediaINFO STEP 1"); + appDBugLog("SET setMediaINFO:"); foreach my $key (keys %mediaINFO) { appDBugLog("SET\t$key $mediaINFO{$key}"); } - unless ($mediaINFO{'FILENAME'} =~ /mteleplayer\/blk\.mpg$/) { - if ($mediaINFO{'VIDEOFORMAT'}) {$mediaINFO{'ONLYAUDIO'} = 1;} - $mpState{'mediaLength'} = $mediaINFO{'LENGHT'}; - if ($mediaINFO{'VIDEOFORMAT'} eq 0) { + + if ($mediaINFO{'VIDEOFORMAT'} eq 0) { + $mediaINFO{'ONLYAUDIO'} = 1; + appCOM("ONLYAUDIO|1|"); $mpState{'noshow'} = 1; - } else { - $mpState{'noshow'} = 0; - } - - doReportTimePos("0.00",$mpState{'mediaLength'}); - $mediaINFO{'MEDIAINFOSET'} = 1; } else { -# setMediaInfo(0); + appCOM("ONLYAUDIO|0|"); + $mpState{'noshow'} = 0; } + $mpState{'mediaLength'} = $mediaINFO{'LENGHT'}; + doReportTimePos("0.00",$mpState{'mediaLength'}); + + $mediaINFO{'MEDIAINFOSET'} = 1; + overlayStateChange(); } elsif ((uc($_[0]) =~ /^([A-Z]{3,})$/) and (length($_[1]) > 0)) { $mediaINFO{$1} = $_[1]; diff --git a/serverside/bin/mteleplayer b/serverside/bin/mteleplayer index fb455f7..586c73f 100755 --- a/serverside/bin/mteleplayer +++ b/serverside/bin/mteleplayer @@ -76,7 +76,7 @@ our %sstatusi;$sstatusi{'sockState'} = 0;$sstatusi{'sockRetryCnt'} = 0;$sstatusi $sstatusi{'lastCOMtime'} = (time()+2);$sstatusi{'remoteInitCnt'} = 0; my %PlayerStatus;$PlayerStatus{'timePos'} = 0;$PlayerStatus{'timeLength'} = 0;$PlayerStatus{'paused'} = 0;$PlayerStatus{'stoped'} = 0;$PlayerStatus{'muted'} = 0;$PlayerStatus{'volume'} = 100;$PlayerStatus{'caching'} = 0; - $PlayerStatus{'seekTimeLag'} = 0;$PlayerStatus{'initialMediaID'} = 0;$PlayerStatus{'fullscreen'} = 0; + $PlayerStatus{'seekTimeLag'} = 0;$PlayerStatus{'initialMediaID'} = 0;$PlayerStatus{'fullscreen'} = 0;$PlayerStatus{'OnylAudio'} = 0; $PlayerStatus{'theOpenerDir'} = setOpenerDir(0); our ($UserName,$UserHome,$X2GoSID,$X2GoSesHome,$X2GoTKSHome,$TeKiLSockPath) = getBasicServersideInfo(); my $LocalSocket; @@ -522,6 +522,16 @@ sub handleTheLocalSocket { toggleBLACKOUT(0); appCOM("SUP"); } + + if ($1 =~ /^ONLYAUDIO\|(\d)\|.*$/) { + if ($1 eq 1) { + $PlayerStatus{'OnylAudio'} = 1; + $GTKS{'MainMediaEBOXGFX'}->set_from_pixbuf($GTKS{'PixBUF'}{'musicalNote'}); + } else { + $PlayerStatus{'OnylAudio'} = 0; + $GTKS{'MainMediaEBOXGFX'}->set_from_pixbuf($GTKS{'PixBUF'}{'eyesore'}); + } + } if ($1 =~ /^CACHING\|([\d\.\%]*)\|.*/) { $GTKS{'INFO'}{'PLYRSTAT'}{'LABEL'}->set_text("Caching Media: $1%"); @@ -543,7 +553,7 @@ sub handleTheLocalSocket { if ($PlayerStatus{'caching'} eq 1) { $PlayerStatus{'caching'} = 0; $GTKS{'INFO'}{'PLYRSTAT'}{'EBOX'}->hide_all; - $GTKS{'MainMediaEBOXGFX'}->set_from_pixbuf($GTKS{'PixBUF'}{'eyesore'}); +# $GTKS{'MainMediaEBOXGFX'}->set_from_pixbuf($GTKS{'PixBUF'}{'eyesore'}); } doUpdateTimeLine($1,$2); $PlayerStatus{'currentMediaSeek'} = $1; -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/mteleplayer.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch gzng in repository mteleplayer. commit d47ce4168e0ceb7c0bc34f54130bb33e0c714ac8 Author: gznget <opensource@gznianguan.com> Date: Fri Jul 4 03:54:05 2014 +0200 Total rewrite of the overlay visibility and location handling + cleanup --- .../mteleplayer/bin/mteleplayer_clientside | 1078 ++++++++++---------- 1 file changed, 565 insertions(+), 513 deletions(-) diff --git a/clientside/lib/telekinesis/client/applications/mteleplayer/bin/mteleplayer_clientside b/clientside/lib/telekinesis/client/applications/mteleplayer/bin/mteleplayer_clientside index 8594ee0..0ddb134 100755 --- a/clientside/lib/telekinesis/client/applications/mteleplayer/bin/mteleplayer_clientside +++ b/clientside/lib/telekinesis/client/applications/mteleplayer/bin/mteleplayer_clientside @@ -60,94 +60,115 @@ our $theLIBDIR = sanitizeDirPath("$TeKiPaths{'LIB'}/client/applications/mtelep my $mpFH = FileHandle->new; our %CmdFlags = getCmdFlags(@ARGV); -our ($UserName,$UserHome,$X2GoSID,$X2GoSesHome,$X2GoTKSHome,$TeKiLSockPath) = getBasicClientsideInfo($CmdFlags{'X2GOSID'}); +our ($UserName,$UserHome,$X2GoSID,$X2GoSesHome,$X2GoTKSHome,$TeKiLSockPath) = getBasicClientsideInfo($CmdFlags{'X2GOSID'}); + appDBugLog("-------------------------------------------\nStarting....."); + my $selfSID; -if (clups($CmdFlags{'OWNSID'}) =~ /^([a-zA-Z0-9]{3,32})$/) {$selfSID = $1;} else {appDBugLog("My own SID is invalid?");doSelfTerminate();} +if (clups($CmdFlags{'OWNSID'}) =~ /^([a-zA-Z0-9]{3,32})$/) { + $selfSID = $1; +} else { + appDBugLog("My own SID is invalid?"); + doSelfTerminate(); +} my $slaveToken; -if (clups($CmdFlags{'SLAVETOKEN'}) =~ /^([a-zA-Z0-9]{3,32})$/) {$slaveToken = $1;} -else {appDBugLog("Slave token is invalid is invalid?");doSelfTerminate();} +if (clups($CmdFlags{'SLAVETOKEN'}) =~ /^([a-zA-Z0-9]{3,32})$/) { + $slaveToken = $1; +} else { + appDBugLog("Slave token is invalid is invalid?"); + doSelfTerminate(); +} our %TnW; our %sstatusi; -$sstatusi{'sockState'} = 0;$sstatusi{'sockRetryCnt'} = 0;$sstatusi{'runState'} = "I";$sstatusi{'linkState'} = 0;$sstatusi{'dodgeMouse'} = 0; -$sstatusi{'startTime'} = time();$sstatusi{'xposX'} = 10;$sstatusi{'xposY'} = 10;$sstatusi{'xposH'} = 0;$sstatusi{'xposW'} = 0;$sstatusi{'xposV'} = 0; -$sstatusi{'X2GoWFullScreen'} = 1;$sstatusi{'X2GoWVisible'} = 1;$sstatusi{'X2GoWax'} = 0;$sstatusi{'X2GoWay'} = 0;$sstatusi{'X2GoWh'} = 0;$sstatusi{'X2GoWw'} = 0; -$sstatusi{'FinalPosX'} = 0;$sstatusi{'FinalPosY'} = 0;$sstatusi{'FinalPosH'} = 10;$sstatusi{'FinalPosW'} = 10;$sstatusi{'FinalPosV'} = 0; +our %olMagic; + +$sstatusi{'sockState'} = 0; +$sstatusi{'sockRetryCnt'} = 0; +$sstatusi{'runState'} = "I"; +$sstatusi{'linkState'} = 0; +$sstatusi{'startTime'} = time(); my $RemoteAppDataDIR = sanitizeDirPath("$X2GoTKSHome/remote/appData/mteleplayer_$selfSID"); -unless (-d "$X2GoTKSHome/local/appData") {mkdir("$X2GoTKSHome/local/appData");} -unless (-d "$X2GoTKSHome/local/appData/mteleplayer_$selfSID") {mkdir("$X2GoTKSHome/local/appData/mteleplayer_$selfSID");} + +unless (-d "$X2GoTKSHome/local/appData") { + mkdir("$X2GoTKSHome/local/appData"); +} + +unless (-d "$X2GoTKSHome/local/appData/mteleplayer_$selfSID") { + mkdir("$X2GoTKSHome/local/appData/mteleplayer_$selfSID"); +} + my $LocalAppDataDIR = sanitizeDirPath("$X2GoTKSHome/local/appData/mteleplayer_$selfSID"); + my $SlaveFIFO = "$LocalAppDataDIR/mpslave.fifo"; if (-e $SlaveFIFO) { - unlink($SlaveFIFO); + unlink($SlaveFIFO); } mkfifo($SlaveFIFO, 0700); -unless (-p $SlaveFIFO) {appDBugLog("$SlaveFIFO No FIFO pipe form mplayer slave?");doSelfTerminate();} +unless (-p $SlaveFIFO) { + appDBugLog("$SlaveFIFO No FIFO pipe form mplayer slave?"); + doSelfTerminate(); +} + my $mPlayerPath = "/usr/bin/mplayer"; if (-x "/usr/bin/mplayer2") { - $mPlayerPath = "/usr/bin/mplayer2"; + $mPlayerPath = "/usr/bin/mplayer2"; } -appDBugLog("MPS FIFO: $SlaveFIFO"); -$ENV{'MPSLAVEFIFOPATH'} = $SlaveFIFO; -$ENV{'MTPSES_LOCALDATA'} = $LocalAppDataDIR; -$ENV{'MTPC_SHAREPATH'} = $theSHAREDIR; -my $myHomeDir = $ENV{'MTPC_HOMEPATH'}; - my $LocalSocket; - if (-S $TeKiLSockPath) { -# We used to do connection stuff here... we still may want to do something here.... who knows... + # We used to do connection stuff here... we still may want to do something here.... who knows... } else { - appDBugLog("No Telekinesis local socket available at: $TeKiLSockPath\n\nIs Telekinesis even running?");doSelfTerminate(); + appDBugLog("No Telekinesis local socket available at: $TeKiLSockPath\n\nIs Telekinesis even running?");doSelfTerminate(); } - -$sstatusi{'runState'} = "R"; -##################################### ##################################### ##################################### ##################################### -# The Main Gtk2 event loop -my %mpState;$mpState{'MediaERROR'} = 0;$mpState{'FakeFS'} = 0;$mpState{'mediaPos'} = 0; $mpState{'mediaLength'} = 0;$mpState{'paused'} = 0; +my %mpState; +$mpState{'MediaERROR'} = 0; +$mpState{'FakeFS'} = 0; +$mpState{'mediaPos'} = 0; +$mpState{'mediaLength'} = 0; +$mpState{'paused'} = 0; $mpState{'noshow'} = 1; $mpState{'mute'} = 0; $mpState{'volume'} = 0;# Change this to get from server side! $mpState{'osd'} = 0; -$mpState{'LASTINPUT'} = "";$mpState{'prevSecond'} = 0; +$mpState{'LASTINPUT'} = ""; +$mpState{'prevSecond'} = 0; ###########################33 # INIT MEDIA INFO my %MediaINFO; setMediaInfo(0); # INIT MEDIA INFO ########################## -$sstatusi{'lastCOMtime'} = (time()+2); -$TnW{'timeoutRound'} = Glib::Timeout->add (1000, sub {appCOM("YO!");if ($sstatusi{'lastCOMtime'} < (time()-2)) {&doSelfTerminate;}1;}); -#$TnW{'overlaystatechange'} = Glib::Timeout->add (250, \&overlayStateChange); -connectionPresistance(); +$sstatusi{'lastCOMtime'} = (time()+5);# Initiate "lastCOMtime" so we dont crash and burn before we ever get started... +$sstatusi{'runState'} = "R"; +##################################### ##################################### ##################################### ##################################### +# The Main Gtk2 event loop Gtk2->init; my $window = Gtk2::Window->new('popup'); -$window->set_title('Telekinesis/Teleplay'); +$window->set_title('mTelePlayer OVERLAY'); $window->set_border_width(0); -$window->set_size_request($sstatusi{'FinalPosW'},$sstatusi{'FinalPosH'}); my $vbox = Gtk2::VBox->new( FALSE, 0 ); my $ebox = Gtk2::EventBox->new; $ebox->modify_bg('normal',Gtk2::Gdk::Color->new(0x0000, 0x0000, 0x0000)); $vbox->pack_start($ebox, TRUE, TRUE, 0); $window->add($vbox); -#$window->set_position ('center-always'); $vbox->set_border_width(0); - $window->set_decorated(0); $window->set_keep_above(1); $window->signal_connect(event => \&windowEvent); $window->show_all(); -do_mplayer(); -$window->hide_all(); -$TnW{'transglitcpresistance'} = Glib::Timeout->add (100, \&connectionPresistance); +&do_mplayer; +doOverlayMagic('init'); + +$TnW{'timeoutRound'} = Glib::Timeout->add (1000, sub {appCOM("YO!");if ($sstatusi{'lastCOMtime'} < (time()-2)) {&doSelfTerminate;}1;}); +$TnW{'transglitcpresistance'} = Glib::Timeout->add(100, \&connectionPresistance); +$TnW{'mouseDeDodger'} = Glib::Timeout->add(100, sub {if ($olMagic{'dodgeMouse'} eq 1) {doOverlayMagic('dodgemouse',0);}1;}); Gtk2->main; # The Main Gtk2 event loop @@ -155,534 +176,565 @@ Gtk2->main; appDBugLog("Execution came to a natural end..."); # Nothing but SUBS past this point.... -############################################################################################################################################## -############################################################################################################################################ ################################################################################################################################# # HERE IS WHERE WE PUT ALL THE SUBS FOR THIS APP + + ################################################################################################################################# # Basic Socket Stuff sub connectionPresistance { - unless ($ENV{'EPICFAIL'} or $EPICFAIL) { - my $time = time(); - - if (($sstatusi{'dodgeMouse'} ne 0) ){ -# print " MOUSE DODGE detected! ($sstatusi{'dodgeMouse'} $sstatusi{'xposV'})\n"; - $sstatusi{'dodgeMouse'} = 0; - if ($sstatusi{'xposV'} eq 1) { -# print "Re displaying window\n"; - $window->show_all(); - $window->resize($sstatusi{'FinalPosW'},$sstatusi{'FinalPosH'}); - $window->move($sstatusi{'FinalPosX'},$sstatusi{'FinalPosY'}); - } - } - -# appDBugLog("LOOP $time $sstatusi{'sockState'}"); - if ($sstatusi{'startTime'} < ($time-5) and ($sstatusi{'sockState'} ne 3)) { - appDBugLog("Its been too long and we still dont have a connection?\nTime to give up!");doSelfTerminate(); - } - if (($sstatusi{'runState'} eq "R") and ($sstatusi{'sockState'} eq 0)) { - if (($sstatusi{'sockState'} eq 0) and ( ! defined $LocalSocket)) { - $sstatusi{'sockState'} = 1; - appDBugLog("Attempting to initiate local socket connection..."); - if ($sstatusi{'sockRetryCnt'} > 0) {# If ther a momentary glitch we'd want to tolerate that but if thers a major problem.... - if ($sstatusi{'sockRetryCnt'} > 10) {# This is a silly attempt at avoiding endless loops when nothing is likely to ever change.. - appDBugLog("Too many retry attemps at opening the socket connection...\nThere is a problem bigger than just a sporadic glitch..."); - doSelfTerminate(); - } else { # And if thers a problem why not give it some time to hopefully recover - my $sleepTime = (($sstatusi{'sockRetryCnt'}*100000)*2);# For every attempt we wait a bit longer.... - appDBugLog("Sleeping for: $sleepTime u"); - usleep($sleepTime); - } - } - $sstatusi{'sockRetryCnt'}++; - if (-S $TeKiLSockPath) { - $LocalSocket= IO::Socket::UNIX->new( Peer => $TeKiLSockPath, - Type => SOCK_STREAM, - Timeout => 10 ); - } else { - appDBugLog("No Telekinesis local socket available at: $TeKiLSockPath\n\nIs Telekinesis even running?");doSelfTerminate(); - } - if (defined $LocalSocket){ - $sstatusi{'sockRetryCnt'} = 0; - $sstatusi{'sockState'} = 1; - appDBugLog("Connected to local socket!"); - $TnW{'LocalSocketWatcher'} = Glib::IO->add_watch( fileno($LocalSocket), [qw/in hup err/], \&handleTheLocalSocket, $LocalSocket); - print $LocalSocket "APP|INITC|mteleplayer|$selfSID|$slaveToken|\n"; - } else { - $sstatusi{'sockState'} = 0; - appDBugLog("ERROR: Can't connect to local socket\nTrying to reconnect in a bit..."); - } - - - - } - } - return 1; - } + unless ($ENV{'EPICFAIL'} or $EPICFAIL) { + my $time = time(); + if ($sstatusi{'startTime'} < ($time-5) and ($sstatusi{'sockState'} ne 3)) { + appDBugLog("Its been too long and we still dont have a connection?\nTime to give up!"); + doSelfTerminate(); + } + if (($sstatusi{'runState'} eq "R") and ($sstatusi{'sockState'} eq 0)) { + if (($sstatusi{'sockState'} eq 0) and ( ! defined $LocalSocket)) { + $sstatusi{'sockState'} = 1; + appDBugLog("Attempting to initiate local socket connection..."); + if ($sstatusi{'sockRetryCnt'} > 0) {# If ther a momentary glitch we'd want to tolerate that but if thers a major problem.... + if ($sstatusi{'sockRetryCnt'} > 10) {# This is a silly attempt at avoiding endless loops when nothing is likely to ever change.. + appDBugLog("Too many retry attemps at opening the socket connection...\nThere is a problem bigger than just a sporadic glitch..."); + doSelfTerminate(); + } else { # And if thers a problem why not give it some time to hopefully recover + my $sleepTime = (($sstatusi{'sockRetryCnt'}*100000)*2);# For every attempt we wait a bit longer.... + appDBugLog("Sleeping for: $sleepTime u"); + usleep($sleepTime); + } + } + $sstatusi{'sockRetryCnt'}++; + + if (-S $TeKiLSockPath) { + $LocalSocket= IO::Socket::UNIX->new( Peer => $TeKiLSockPath, + Type => SOCK_STREAM, + Timeout => 10 ); + } else { + appDBugLog("No Telekinesis local socket available at: $TeKiLSockPath\n\nIs Telekinesis even running?");doSelfTerminate(); + } + + if (defined $LocalSocket) { + $sstatusi{'sockRetryCnt'} = 0; + $sstatusi{'sockState'} = 1; + appDBugLog("Connected to local socket!"); + $TnW{'LocalSocketWatcher'} = Glib::IO->add_watch( fileno($LocalSocket), [qw/in hup err/], \&handleTheLocalSocket, $LocalSocket); + print $LocalSocket "APP|INITC|mteleplayer|$selfSID|$slaveToken|\n"; + } else { + $sstatusi{'sockState'} = 0; + appDBugLog("ERROR: Can't connect to local socket\nTrying to reconnect in a bit..."); + } + + } + } + + return 1; + } } ################################################################################################################################# # Handle incomming stuff from the localsocket sub handleTheLocalSocket { - my ( $fd, $condition, $fh ) = @_; - if ( $condition >= 'hup' or $condition >= 'err' ) { - $sstatusi{'sockState'} = 0; - $LocalSocket->close; - $LocalSocket = undef; - return 0; - } - if ( $condition >= 'in' ) { - my $bytes = sysread($fh,my $data,4096); - if ( length $data ) { - foreach my $dataLine (split(/\n/,$data)) {if (length(clups($dataLine)) > 0) { - # Do something smarter in the future - my $saneData = sanitizer("anumazcsdausdotspipe","$dataLine"); - -# if ($sstatusi{'sockState'} eq 1) {} - if ($saneData =~ /^APPCOM\|(.*)$/) { - $sstatusi{'lastCOMtime'} = time(); - if ($1 =~ /^HELLO/) { - $sstatusi{'sockState'} = 3; - print $LocalSocket "CORE|LOCALSERVICES|mteleplayer|$selfSID|StateOfX2GoCliWin|\n"; - } elsif ($1 =~ /^TERMINATE/) { - doSelfTerminate(); - } - if ($1 =~ /^SET\|AUDIOVOLUME\|(\d{1,3})\|.*/) { - my $newVol = $1; - if (($newVol >= 0) and ($newVol <= 100)) { - $mpState{'volume'} = $newVol; - mpCMD("volume $mpState{'volume'} 1"); - } - } - if ($1 =~ /^XPOSTAT\|(\d*)\|(\d*)\|(\d*)\|(\d*)\|(\d)\|/) { - $sstatusi{'xposX'} = $1; - $sstatusi{'xposY'} = $2; - $sstatusi{'xposH'} = $3; - $sstatusi{'xposW'} = $4; - $sstatusi{'xposV'} = $5; - overlayStateChange(); - } + my ( $fd, $condition, $fh ) = @_; + + if ( $condition >= 'hup' or $condition >= 'err' ) { + $sstatusi{'sockState'} = 0; + $LocalSocket->close; + $LocalSocket = undef; + return 0; + } + + if ( $condition >= 'in' ) { + my $bytes = sysread($fh,my $data,4096); + if (length($data) > 0) { + foreach my $dataLine (split(/\n/,$data)) { + if (length(clups($dataLine)) > 0) { + my $saneData = sanitizer("anumazcsdausdotspipe","$dataLine"); + + if ($saneData =~ /^APPCOM\|(.*)$/) { + $sstatusi{'lastCOMtime'} = time(); + if ($1 =~ /^HELLO/) { + $sstatusi{'sockState'} = 3; + print $LocalSocket "CORE|LOCALSERVICES|mteleplayer|$selfSID|StateOfX2GoCliWin|\n"; + } elsif ($1 =~ /^TERMINATE/) { + doSelfTerminate(); + } + if ($1 =~ /^SET\|AUDIOVOLUME\|(\d{1,3})\|.*/) { + my $newVol = $1; + if (($newVol >= 0) and ($newVol <= 100)) { + $mpState{'volume'} = $newVol; + mpCMD("volume $mpState{'volume'} 1"); + } + } + if ($1 =~ /^XPOSTAT\|(\-?\d*)\|(\-?\d*)\|(\d*)\|(\d*)\|(\d)\|.*/) { + doOverlayMagic('ssappwin',$1,$2,$3,$4,$5); + } -if ($1 =~ /^MPCMD\|PLAYMEDIA\|([0-9a-zA-Z]{24,64})\|([A-Z]{3,4})\|(\d*)\|(\d*)\|.*/) { - my $Type = 0; - my $StartSeek = 0; - my $StartPaused = 0; - if ($3 > 0) { - $StartSeek = $3; + if ($1 =~ /^MPCMD\|PLAYMEDIA\|([0-9a-zA-Z]{24,64})\|([A-Z]{3,4})\|(\d*)\|(\d*)\|.*/) { + my $Type = 0; + my $StartSeek = 0; + my $StartPaused = 0; + if ($3 > 0) { + $StartSeek = $3; + } + if ($4 eq 1) {$StartPaused = 1;} + appDBugLog("GOT PLAY COMMAND: 1:$1 2:$2 3:$3"); + if ($2 eq "FILE") { + my $theMediaFilePath = "$RemoteAppDataDIR/$1.file";# SANETIZE THIS MAYBE? + appDBugLog(" FILE:$theMediaFilePath"); + if (-e $theMediaFilePath) { + appDBugLog("THAT FILE EXISTS!!"); + doOverlayMagic('onlyaudio',1);# Just abusing the "onlyaudio" function to hide overlay while caching... + setMediaInfo(0); + mpCMD("loadfile $theMediaFilePath"); + if ($mpState{'FakeFS'} ne 1) {mpCMD("osd 0");} + mpCMD("volume $mpState{'volume'} 1"); + mpCMD("pausing pause");# Load into a paused state + if ($StartSeek > 0) { + mpCMD("seek $StartSeek 2"); + } + if ($StartPaused ne 1) { + mpCMD("pause");# Unpause + } + } + } + # elsif ($2 =~ /URL/) {$Type = "url";} + + } elsif ($1 =~ /^MPCMD\|FRAMESTEP\|/) { + mpCMD("frame_step"); + } elsif ($1 =~ /^MPCMD\|PAUSE\|/) { + mpCMD("pausing pause"); + } elsif ($1 =~ /^MPCMD\|PLAY\|/) { + mpCMD("pausing pause"); + mpCMD("pause"); + } elsif ($1 =~ /^MPCMD\|SEEK\|(\d*)\|/) { + if ($1 <= $mpState{'mediaLength'}) { + mpCMD("seek $1 2"); + } + } elsif ($1 =~ /^MPCMD\|KEYSEEK\|(\-?\d*)\|/) { + my $newPos = ($mpState{'mediaPos'}+$1); + if ($newPos < 0) {$newPos = 0;} + if ($newPos > ($mpState{'mediaLength'}-1)) { + mpCMD("pausing frame_step"); + inList2Play("next"); + } else { + mpCMD("seek $newPos 2"); + } + } + + } elsif ($saneData =~ /^CORE\|SERVICES\|X2GOWINDOWSTATE\|(\d)\|(\d)\|(\-?\d*)\|(\-?\d*)\|(\d*)\|(\d*)\|/) { + doOverlayMagic('csseswin',$1,$2,$3,$4,$5,$6); + } elsif ($saneData =~ /^TERMINATE\|([\w\_]*)\|$/) { + my $vmessage; + if ($1 =~ /NO_PAIR1/) { + $vmessage = "Client and server dont seem to be on the same page....\n\nIncompatible versions of mTelePlayer on the cliet side..."; + } elsif ($1 =~ /NO_PAIR2/) { + $vmessage = "Client and server dont seem to be on the same page....\n\nThe client side do not have mTelePlayer installed!?"; + } elsif ($1 =~ /DUPLICATE/) { + $vmessage = "Killed in the name of duplicate termination!"; + } + appDBugLog($vmessage); + doSelfTerminate(); + } + appDBugLog("RMX:$saneData"); + } + } + + } else { + appDBugLog("Closing local socket.."); + $LocalSocket->close; + $fh->close; + $fh = undef; + $sstatusi{'sockState'} = 0; + return 0; + } + } - } - if ($4 eq 1) {$StartPaused = 1;} - appDBugLog("GOT PLAY COMMAND: 1:$1 2:$2 3:$3"); - if ($2 eq "FILE") { - my $theMediaFilePath = "$RemoteAppDataDIR/$1.file";# SANETIZE THIS MAYBE? - appDBugLog(" FILE:$theMediaFilePath"); - if (-e $theMediaFilePath) { - appDBugLog(" THAT FILE EXISTS!!"); - setMediaInfo(0); - $mpState{'noshow'} = 1; - overlayStateChange(); - mpCMD("loadfile $theMediaFilePath"); - if ($mpState{'FakeFS'} ne 1) {mpCMD("osd 0");} - mpCMD("volume $mpState{'volume'} 1"); - mpCMD("pausing pause");# Load into a paused state - if ($StartSeek > 0) { - mpCMD("seek $StartSeek 2"); - } - if ($StartPaused ne 1) { - mpCMD("pause");# Unpause - } - } - } -# elsif ($2 =~ /URL/) {$Type = "url";} - - $window->show_all(); - $window->resize($sstatusi{'FinalPosW'},$sstatusi{'FinalPosH'}); - $window->move($sstatusi{'FinalPosX'},$sstatusi{'FinalPosY'}); - overlayStateChange(); -} elsif ($1 =~ /^MPCMD\|FRAMESTEP\|/) { - mpCMD("frame_step"); -} elsif ($1 =~ /^MPCMD\|PAUSE\|/) { - mpCMD("pausing pause"); -} elsif ($1 =~ /^MPCMD\|PLAY\|/) { - mpCMD("pausing pause"); - mpCMD("pause"); -} elsif ($1 =~ /^MPCMD\|SEEK\|(\d*)\|/) { - if ($1 <= $mpState{'mediaLength'}) { - mpCMD("seek $1 2"); - } -} elsif ($1 =~ /^MPCMD\|KEYSEEK\|(\-?\d*)\|/) { - my $newPos = ($mpState{'mediaPos'}+$1); - if ($newPos < 0) {$newPos = 0;} - if ($newPos > ($mpState{'mediaLength'}-1)) { - mpCMD("pausing frame_step"); - inList2Play("next"); - } else { - mpCMD("seek $newPos 2"); - } -} - - -#if ($1 =~ /^MPCMD\|STOP\|/) { -# mpCMD("pausing loadfile $theSHAREDIR/blk.mpg"); -# mpCMD("pause"); -# $window->hide_all(); -#} - } elsif ($saneData =~ /^CORE\|SERVICES\|X2GOWINDOWSTATE\|(\d)\|(\d)\|(\d*)\|(\d*)\|(\d*)\|(\d*)\|/) { -#print "CORE CHANGE $1\n"; - my $retogglevis = 0; - if ($sstatusi{'X2GoWFullScreen'} ne $1) {$retogglevis = 1;} -# if (($sstatusi{'X2GoWh'} ne $5) or ($sstatusi{'X2GoWw'} ne $6)) { -#print "REQUESTING UPDATED XPOS>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n"; -# appCOM("GET|XPOS|1"); -# } - $sstatusi{'X2GoWFullScreen'} = $1; - $sstatusi{'X2GoWVisible'} = $2; - $sstatusi{'X2GoWax'} = $3; - $sstatusi{'X2GoWay'} = $4; - $sstatusi{'X2GoWh'} = $5; - $sstatusi{'X2GoWw'} = $6; - overlayStateChange(); - if ($retogglevis eq 1) { - $window->hide_all(); - - $window->show_all(); - $window->resize($sstatusi{'FinalPosW'},$sstatusi{'FinalPosH'}); - $window->move($sstatusi{'FinalPosX'},$sstatusi{'FinalPosY'}); - } - - } elsif ($saneData =~ /^TERMINATE\|([\w\_]*)\|$/) { - my $vmessage; - if ($1 =~ /NO_PAIR1/) {$vmessage = "Client and server dont seem to be on the same page....\n\nIncompatible versions of mTelePlayer on the cliet side...";} - elsif ($1 =~ /NO_PAIR2/) {$vmessage = "Client and server dont seem to be on the same page....\n\nThe client side do not have mTelePlayer installed!?";} - elsif ($1 =~ /DUPLICATE/) {$vmessage = "Killed in the name of duplicate termination!";} - - appDBugLog($vmessage);doSelfTerminate(); - } - - appDBugLog("RMX:$saneData"); - - - }} - } else{ - # close socket as there is no data - appDBugLog("Closing local socket.."); - $LocalSocket->close; - $fh->close; - $fh = undef; - $sstatusi{'sockState'} = 0; - Gtk2->main_iteration while Gtk2->events_pending; - return 0; - - } - } - - if ($fh) {# the file handle is still open, so return TRUE possibly have a "connection alive" indicator# print "still connected\n"; - return TRUE; - } else { # we're finished with this job. start another one, if there are any, and uninstall ourselves. - appDBugLog("The connection is closed!\n"); - return FALSE; - } + if ($fh) { + return TRUE; + } else { + appDBugLog("The connection is closed!\n"); + return FALSE; + } } sub appCOM { - my $ComData = sanitizer("anumazcsdausdotspipe",$_[0]); - print $LocalSocket "\nAPPCOM|mteleplayer|$selfSID|$ComData|\n"; -} - - - -sub overlayStateChange { - my %newXPos; - - if ($sstatusi{'X2GoWFullScreen'} eq 1) { - $sstatusi{'X2GoWVisible'} = 1; - $newXPos{'X'} = $sstatusi{'xposX'}; - $newXPos{'Y'} = $sstatusi{'xposY'}; - } else { - $newXPos{'X'} = $sstatusi{'xposX'} + $sstatusi{'X2GoWax'}; - $newXPos{'Y'} = $sstatusi{'xposY'} + $sstatusi{'X2GoWay'}; - } - - $newXPos{'W'} = $sstatusi{'xposW'}; - $newXPos{'H'} = $sstatusi{'xposH'}; - - if (($sstatusi{'X2GoWVisible'} eq 1) and ($sstatusi{'xposV'} eq 1)) { - if ($mpState{'noshow'} eq 1) { - $newXPos{'V'} = 0; - } else { - $newXPos{'V'} = 1; - } - } else { - $newXPos{'V'} = 0; - } - - - if (($newXPos{'X'} ne $sstatusi{'FinalPosX'}) or ($newXPos{'Y'} ne $sstatusi{'FinalPosY'})) { - $sstatusi{'FinalPosX'} = $newXPos{'X'}; - $sstatusi{'FinalPosY'} = $newXPos{'Y'}; -# print "MOVE: $newXPos{'X'},$newXPos{'Y'}\n"; - $window->move($newXPos{'X'},$newXPos{'Y'}); -#$window->set_position($sstatusi{'xposX'},$sstatusi{'xposY'}); - } - - if (($newXPos{'H'} ne $sstatusi{'FinalPosH'}) or ($newXPos{'W'} ne $sstatusi{'FinalPosW'})) { - $sstatusi{'FinalPosH'} = $newXPos{'H'}; - $sstatusi{'FinalPosW'} = $newXPos{'W'}; - $window->resize($newXPos{'W'},$newXPos{'H'}); - } - - - if (($newXPos{'V'} ne $sstatusi{'FinalPosV'}) or ($mpState{'noshow'} eq 1)) { - $sstatusi{'FinalPosV'} = $newXPos{'V'}; - if ($newXPos{'V'} eq 1) { - $window->show_all(); - $window->resize($sstatusi{'FinalPosW'},$sstatusi{'FinalPosH'}); - $window->move($sstatusi{'FinalPosX'},$sstatusi{'FinalPosY'}); - } else { - $window->hide_all(); - } - } - - return 1; - + my $ComData = sanitizer("anumazcsdausdotspipe",$_[0]); + print $LocalSocket "\nAPPCOM|mteleplayer|$selfSID|$ComData|\n"; } ##################################################################3 # MPLAYER STUFF sub do_mplayer{ - my $gdkwindow1 = $ebox->window; - my $xid= $gdkwindow1->XWINDOW; - my $pid = open($mpFH,"-|",$mPlayerPath,'-slave','-input' ,"file=$SlaveFIFO", '-vo','gl','-framedrop','-fs','-wid',$xid,'-volume','0', '-identify','-idle','-nolirc','-cache','4096'); - $TnW{'mplayerIOwatcher'} = Gtk2::Helper->add_watch( $mpFH->fileno, 'in', sub {watch_mplayerOutput( $mpFH,$TnW{'mplayerIOwatcher'} );}); + my $gdkwindow1 = $ebox->window; + my $xid= $gdkwindow1->XWINDOW; + my $pid = open($mpFH,"-|",$mPlayerPath,'-slave','-input' ,"file=$SlaveFIFO", '-vo','gl','-framedrop','-fs','-wid',$xid,'-volume','0', '-identify','-idle','-nolirc','-cache','4096'); + $TnW{'mplayerIOwatcher'} = Gtk2::Helper->add_watch( $mpFH->fileno, 'in', sub {watch_mplayerOutput( $mpFH,$TnW{'mplayerIOwatcher'} );}); } sub inList2Play { - appDBugLog("Do stuff at end of file or at next or prev button press"); - mpCMD("pausing seek 0 2"); # Currently we're only supporting one file so just seek to 0 and pause.... - return 1; + appDBugLog("Do stuff at end of file or at next or prev button press"); + mpCMD("pausing seek 0 2"); # Currently we're only supporting one file so just seek to 0 and pause.... + return 1; } sub doPauseStuff { - if ($_[0] eq "pause") { - unless ($mpState{'paused'} eq 1) { appDBugLog(">>>> PAUSED <<<<"); - $mpState{'paused'} = 1; - appCOM("PAUSED|1|"); - } - } else { - if ($mpState{'paused'} eq 1) { appDBugLog("UN-PAUSED"); - $mpState{'paused'} = 0; - appCOM("PAUSED|0|"); - } - } - return 1; + if ($_[0] eq "pause") { + unless ($mpState{'paused'} eq 1) { + appDBugLog(">>>> PAUSED <<<<"); + $mpState{'paused'} = 1; + appCOM("PAUSED|1|"); + } + } else { + if ($mpState{'paused'} eq 1) { + appDBugLog("UN-PAUSED"); + $mpState{'paused'} = 0; + appCOM("PAUSED|0|"); + } + } + return 1; } sub doReportTimePos { - my $currentTime = $_[0]; - my $lengthTime = $_[1]; - $currentTime =~ s/\.[\d]*$//g;$lengthTime =~ s/\.[\d]*$//g; -# print "rtp2: $currentTime/$lengthTime\n\n"; - appCOM("UPDATE|TIME|$currentTime|$lengthTime"); + my $currentTime = $_[0]; + my $lengthTime = $_[1]; + $currentTime =~ s/\.[\d]*$//g;$lengthTime =~ s/\.[\d]*$//g; + appCOM("UPDATE|TIME|$currentTime|$lengthTime"); } - sub watch_mplayerOutput { - my ($fh,$tag) = @_; - my $buffer; - if ( not sysread($fh, $buffer, 4096) ) { - Gtk2::Helper->remove_watch ($tag) or die "couldn't remove watcher"; - close($fh); - return 1; - } - foreach my $line (split(/\n/,$buffer)) { - $line =~ s/[\n\r\t]//g; -############### -# Trigers... -# if ($line =~ /^Starting playback\.\.\./) {# mpCMD("get_file_name"); -# if ($mpState{'FakeFS'} ne 1) {mpCMD("osd 0");} -# mpCMD("get_time_length"); -# mpCMD("volume $mpState{'volume'} 1"); -# if ($mpState{'notInitial'} ne 1) { -# $mpState{'notInitial'} = 1; -# appCOM("GIVEMEFIRSTMEDIATOINIT"); -# } -# } -# Triggers -############### -# ANSWERS - if ($line =~ /^ID/) { - ############################# - # GET MEDIA INFO - if ($mediaINFO{'MEDIAINFOSET'} ne 1) { - if ($line =~ /^ID_VIDEO_FORMAT\=(.*)$/) { - $mediaINFO{'VIDEOFORMAT'} = $1; - } elsif ($line =~ /^ID_AUDIO_FORMAT\=(.*)$/) { - $mediaINFO{'AUDIOFORMAT'} = $1; - } elsif ($line =~ /^ID_LENGTH\=([\.\d]*)$/) { - $mediaINFO{'LENGHT'} = $1; - } elsif ($line =~ /^ID_SEEKABLE\=1$/) { - $mediaINFO{'SEEKABLE'} = 1; - } elsif ($line =~ /^ID_FILENAME\=(.*)$/) { - $mediaINFO{'FILENAME'} = $1; - } - } - # GET MEDIA INFO - ############################# - } elsif ($line =~ /^Playing(.*)$/) { - appDBugLog("SET X:$1:X"); - } elsif (($line =~ /======================================/) and ($mediaINFO{'MEDIAINFOSET'} ne 1)) { - appDBugLog("SET STATUS!"); - setMediaInfo(1);# Trigger setMediaInfo DONE... - } elsif ($line =~ /^ANS\_FILENAME\=\'(.*)\'$/) { - $mpState{'mediaFileName'} = $1;# print "File: $1\n"; - } elsif ($line =~ /^ANS\_LENGTH\=([\d\.]*)$/) { -# $mpState{'mediaLength'} = $1; - } elsif ($line =~ /^Cache fill:([\ \d\.\%]*)\((\d*) bytes\)/) { - appDBugLog("Cache fill! [$1] [$2]"); - my $cacheP = $1;$cacheP =~ s/\ //g; - my $cacheB = $2;$cacheB =~ s/\D//g; - appCOM("CACHING|$cacheP|$cacheB|"); - } elsif ($line =~ /===== PAUSE =====/) { - doPauseStuff("pause"); - } elsif (($line =~ /^A:/) or ($line =~ /^V:/)) { - doPauseStuff("unpause"); - if ($line =~ /^A:[\ \.\d]*V:([\ \.\d]*)/) {$mpState{'mediaPos'} = $1;} - elsif ($line =~ /^A:([\ \.\d]*)/) {$mpState{'mediaPos'} = $1;} - elsif ($line =~ /^V:[\ ]*([\.\d]*[\ ]*)/) {$mpState{'mediaPos'} = $1;} - $mpState{'mediaPos'}++;$mpState{'mediaPos'}--; - my ($newSecond,undef) = split(/\./,$mpState{'mediaPos'}); - if ($newSecond ne $mpState{'prevSecond'}) { - $mpState{'prevSecond'} = $newSecond; - doReportTimePos($newSecond,$mpState{'mediaLength'}); - appDBugLog("MP: :$mpState{'mediaLength'}: :$mpState{'mediaPos'}:"); - if ($mpState{'mediaLength'} > 0) { - if (($mpState{'mediaLength'}-1) <= $mpState{'mediaPos'}) { - appDBugLog("LOADPOINT 1! $mpState{'mediaLength'} $mpState{'mediaPos'}"); - mpCMD("pausing frame_step"); - inList2Play("next"); - } - } - } - } elsif ($line =~ /^Failed to open LIRC support/) {#DO NOTHING!! - } elsif (($line =~ /^Failed\ to\ open.*/) or ($line =~ /^File\ not\ found.*/)) { - appDBugLog("NOT A FILE!\n $line"); -# Do something HERE? - } elsif ($line =~ /^Failed\ to\ recognize\ file\ format.*/) { - appDBugLog("NOT A MEDIA FILE!\n $line\n"); -# DO SOMETHING HERE? - } else { - appDBugLog("UNCUAGHT:\n $line\n"); - } -# ANSWERS -############### - } - return 1; + my ($fh,$tag) = @_; + my $buffer; + if ( not sysread($fh, $buffer, 4096) ) { + Gtk2::Helper->remove_watch ($tag) or die "couldn't remove watcher"; + close($fh); + return 1; + } + foreach my $line (split(/\n/,$buffer)) { + $line =~ s/[\n\r\t]//g; + ############### + # ANSWERS + if ($line =~ /^ID/) { + ############################# + # GET MEDIA INFO + if ($mediaINFO{'MEDIAINFOSET'} ne 1) { + if ($line =~ /^ID_VIDEO_FORMAT\=(.*)$/) { + $mediaINFO{'VIDEOFORMAT'} = $1; + } elsif ($line =~ /^ID_AUDIO_FORMAT\=(.*)$/) { + $mediaINFO{'AUDIOFORMAT'} = $1; + } elsif ($line =~ /^ID_LENGTH\=([\.\d]*)$/) { + $mediaINFO{'LENGHT'} = $1; + } elsif ($line =~ /^ID_SEEKABLE\=1$/) { + $mediaINFO{'SEEKABLE'} = 1; + } elsif ($line =~ /^ID_FILENAME\=(.*)$/) { + $mediaINFO{'FILENAME'} = $1; + } + } + # GET MEDIA INFO + ############################# + } elsif ($line =~ /^Playing(.*)$/) { + appDBugLog("Playing: $1"); + } elsif (($line =~ /======================================/) and ($mediaINFO{'MEDIAINFOSET'} ne 1)) { + appDBugLog("SET MEDIAINFO TRIG 1!"); + setMediaInfo(1);# Trigger setMediaInfo DONE... + } elsif ($line =~ /^ANS\_FILENAME\=\'(.*)\'$/) { + $mpState{'mediaFileName'} = $1; + } elsif ($line =~ /^Cache fill:([\ \d\.\%]*)\((\d*) bytes\)/) { + appDBugLog("Cache fill! [$1] [$2]"); + my $cacheP = $1;$cacheP =~ s/\ //g; + my $cacheB = $2;$cacheB =~ s/\D//g; + appCOM("CACHING|$cacheP|$cacheB|"); + } elsif ($line =~ /===== PAUSE =====/) { + doPauseStuff("pause"); + } elsif (($line =~ /^A:/) or ($line =~ /^V:/)) { + doPauseStuff("unpause"); + if ($line =~ /^A:[\ \.\d]*V:([\ \.\d]*)/) {$mpState{'mediaPos'} = $1;} + elsif ($line =~ /^A:([\ \.\d]*)/) {$mpState{'mediaPos'} = $1;} + elsif ($line =~ /^V:[\ ]*([\.\d]*[\ ]*)/) {$mpState{'mediaPos'} = $1;} + $mpState{'mediaPos'}++;$mpState{'mediaPos'}--; + my ($newSecond,undef) = split(/\./,$mpState{'mediaPos'}); + if ($newSecond ne $mpState{'prevSecond'}) { + $mpState{'prevSecond'} = $newSecond; + doReportTimePos($newSecond,$mpState{'mediaLength'}); + appDBugLog("MP: :$mpState{'mediaLength'}: :$mpState{'mediaPos'}:"); + if ($mpState{'mediaLength'} > 0) { + if (($mpState{'mediaLength'}-1) <= $mpState{'mediaPos'}) { + appDBugLog("LOADPOINT 1! $mpState{'mediaLength'} $mpState{'mediaPos'}"); + mpCMD("pausing frame_step"); + inList2Play("next"); + } + } + } + } elsif ($line =~ /^Failed to open LIRC support/) {#DO NOTHING!! + } elsif (($line =~ /^Failed\ to\ open.*/) or ($line =~ /^File\ not\ found.*/)) { + appDBugLog("NOT A FILE!\n $line"); + # Do something HERE? + } elsif ($line =~ /^Failed\ to\ recognize\ file\ format.*/) { + appDBugLog("NOT A MEDIA FILE!\n $line\n"); + # DO SOMETHING HERE? + } else { + appDBugLog("UNCUAGHT:\n $line\n"); + } + # ANSWERS + ############### + } + return 1; } - - sub mpCMD { - open(CTRL,">$SlaveFIFO");print CTRL "$_[0]\n";close(CTRL); + open(CTRL,">$SlaveFIFO");print CTRL "$_[0]\n";close(CTRL); } - sub setMediaInfo { - appDBugLog("SET setMediaINFO :$_[0]:"); - if ($_[0] eq 0) { - $mediaINFO{'AUDIOFORMAT'} = 0; - $mediaINFO{'VIDEOFORMAT'} = 0; - $mediaINFO{'LENGHT'} = 0; - $mediaINFO{'SEEKABLE'} = 0; - $mediaINFO{'FILENAME'} = 0; - $mediaINFO{'ONLYAUDIO'} = 0; - $mediaINFO{'MEDIAINFOSET'} = 0; - } elsif ($_[0] eq 1) { - appDBugLog("SET setMediaINFO:"); - foreach my $key (keys %mediaINFO) { - appDBugLog("SET\t$key $mediaINFO{$key}"); - } + appDBugLog("SET setMediaINFO :$_[0]:"); + if ($_[0] eq 0) { + + $mediaINFO{'AUDIOFORMAT'} = 0; + $mediaINFO{'VIDEOFORMAT'} = 0; + $mediaINFO{'LENGHT'} = 0; + $mediaINFO{'SEEKABLE'} = 0; + $mediaINFO{'FILENAME'} = 0; + $mediaINFO{'ONLYAUDIO'} = 0; + $mediaINFO{'MEDIAINFOSET'} = 0; + + } elsif ($_[0] eq 1) { + + appDBugLog("SET setMediaINFO:"); + foreach my $key (keys %mediaINFO) { + appDBugLog("SET\t$key $mediaINFO{$key}"); + } - if ($mediaINFO{'VIDEOFORMAT'} eq 0) { - $mediaINFO{'ONLYAUDIO'} = 1; - appCOM("ONLYAUDIO|1|"); - $mpState{'noshow'} = 1; - } else { - appCOM("ONLYAUDIO|0|"); - $mpState{'noshow'} = 0; - } - $mpState{'mediaLength'} = $mediaINFO{'LENGHT'}; - doReportTimePos("0.00",$mpState{'mediaLength'}); - - $mediaINFO{'MEDIAINFOSET'} = 1; - - overlayStateChange(); - } elsif ((uc($_[0]) =~ /^([A-Z]{3,})$/) and (length($_[1]) > 0)) { - $mediaINFO{$1} = $_[1]; - } + if ($mediaINFO{'VIDEOFORMAT'} eq 0) { + $mediaINFO{'ONLYAUDIO'} = 1; + appCOM("ONLYAUDIO|1|"); + doOverlayMagic('onlyaudio',1); + } else { + appCOM("ONLYAUDIO|0|"); + doOverlayMagic('onlyaudio',0); + } + + $mpState{'mediaLength'} = $mediaINFO{'LENGHT'}; + doReportTimePos("0.00",$mpState{'mediaLength'}); + $mediaINFO{'MEDIAINFOSET'} = 1; + + } elsif ((uc($_[0]) =~ /^([A-Z]{3,})$/) and (length($_[1]) > 0)) { + $mediaINFO{$1} = $_[1]; + } + } # MPLAYER STUFF ###################################################################### -sub shouldWeBeVisible { - my $visible = 1; - if ($mpState{'noshow'} eq 1) {$visible = 0;} - - if ($visible eq 1) { - return 1; - } else { - return 0; - } +# OVERLAY MAGIC +sub doOverlayMagic { + my $doWHAT = lc($_[0]); + my $changeVis = 0; + my $reTogVis = 0; + my $changePos = 0; + if ($doWHAT eq "init") { + $olMagic{'CsSesWin_FS'} = 0; + $olMagic{'CsSesWin_Vis'} = 0; + $olMagic{'CsSesWin_aX'} = 0; + $olMagic{'CsSesWin_aY'} = 0; + $olMagic{'CsSesWin_Hgt'} = 0; + $olMagic{'CsSesWin_Wdt'} = 0; + + $olMagic{'SsAppWin_X'} = 0; + $olMagic{'SsAppWin_Y'} = 0; + $olMagic{'SsAppWin_Hgt'} = 0; + $olMagic{'SsAppWin_Wdt'} = 0; + $olMagic{'SsAppWin_Vis'} = 0; + + $olMagic{'overlay_X'} = 0; + $olMagic{'overlay_Y'} = 0; + $olMagic{'onlyaudio'} = 1;# Abusing this again... + $olMagic{'visible'} = 0; + $window->hide_all; + } elsif ($doWHAT eq "dodgemouse") { + + if ($_[1] eq 1) { + $olMagic{'dodgeMouse'} = 1; + appDBugLog("Dodging MOUSE"); + } else { + $olMagic{'dodgeMouse'} = 0; + appDBugLog("UnDodging MOUSE"); + } + + } elsif ($doWHAT eq "csseswin") { + + if ($olMagic{'CsSesWin_FS'} ne $_[1]) { + if ($_[1] eq 1) { + $olMagic{'CsSesWin_FS'} = 1; + $reTogVis = 1; + } elsif ($_[1] eq 0) { + $olMagic{'CsSesWin_FS'} = 0; + $reTogVis = 1; + } else { + appDBugLog("ERROR: Got wrong value '$_[1]' for CsSesWin_FS!"); + } + } + + if ($olMagic{'CsSesWin_Vis'} ne $_[2]) { + if ($_[2] eq 1) { + $olMagic{'CsSesWin_Vis'} = 1; + } elsif ($_[2] eq 0) { + $olMagic{'CsSesWin_Vis'} = 0; + } else { + appDBugLog("ERROR: Got wrong value '$_[2]' for CsSesWin_Vis!"); + } + } + + if (($olMagic{'CsSesWin_aX'} ne $_[3]) or ($olMagic{'CsSesWin_aY'} ne $_[4])) { + $olMagic{'CsSesWin_aX'} = $_[3]; + $olMagic{'CsSesWin_aY'} = $_[4]; + $changePos = 1; + } + + if (($olMagic{'CsSesWin_Hgt'} ne $_[5]) or ($olMagic{'CsSesWin_Wdt'} ne $_[6])) { + $olMagic{'CsSesWin_Hgt'} = $_[5]; + $olMagic{'CsSesWin_Wdt'} = $_[6]; + } + + } elsif ($doWHAT eq "ssappwin") { + + if (($olMagic{'SsAppWin_X'} ne $_[1]) or ($olMagic{'SsAppWin_Y'} ne $_[2])) { + $olMagic{'SsAppWin_X'} = $_[1]; + $olMagic{'SsAppWin_Y'} = $_[2]; + $changePos = 1; + } + + if (($olMagic{'SsAppWin_Hgt'} ne $_[3]) or ($olMagic{'SsAppWin_Wdt'} ne $_[4])) { + $olMagic{'SsAppWin_Hgt'} = $_[3]; + $olMagic{'SsAppWin_Wdt'} = $_[4]; + $changePos = 1; + } + + if ($olMagic{'SsAppWin_Vis'} ne $_[5]) { + if ($_[5] eq 1) { + $olMagic{'SsAppWin_Vis'} = 1; + } elsif ($_[5] eq 0) { + $olMagic{'SsAppWin_Vis'} = 0; + } else { + appDBugLog("ERROR: Got wrong value '$_[5]' for SsAppWin_Vis!"); + } + } + } elsif ($doWHAT eq "onlyaudio") { + if ($_[1] eq 1) { + $olMagic{'onlyaudio'} = 1; + } else { + $olMagic{'onlyaudio'} = 0; + } + } + + + + if (($olMagic{'dodgeMouse'} ne 1) and ($olMagic{'onlyaudio'} ne 1)) { + + if (($olMagic{'SsAppWin_Vis'} eq 1) and ($olMagic{'CsSesWin_Vis'} eq 1)) { + if ($olMagic{'visible'} eq 0) { + $olMagic{'visible'} = 1; + $changeVis = 1; + } + } else { + if ($olMagic{'visible'} eq 1) { + $olMagic{'visible'} = 0; + $changeVis = 1; + } + } + + } else { + + if ($olMagic{'visible'} eq 1) { + $olMagic{'visible'} = 0; + $changeVis = 1; + } + + } + + + + + if (($changeVis eq 1) or ($reTogVis eq 1)) { + if ($olMagic{'visible'} eq 0) { + if ($window->visible) { + $window->hide_all; + } + } else { + if ($reTogVis eq 1) { + if ($window->visible) { + $window->hide_all; + } + } + unless ($window->visible) { + $window->move($olMagic{'overlay_X'},$olMagic{'overlay_Y'}); + $window->resize($olMagic{'SsAppWin_Wdt'},$olMagic{'SsAppWin_Hgt'}); + $window->show_all; + $changePos = 1; + } + } + } + + if ($changePos eq 1) { + if ($olMagic{'visible'} eq 1) { + $olMagic{'overlay_X'} = $olMagic{'CsSesWin_aX'}+$olMagic{'SsAppWin_X'}; + $olMagic{'overlay_Y'} = $olMagic{'CsSesWin_aY'}+$olMagic{'SsAppWin_Y'}; + $window->move($olMagic{'overlay_X'},$olMagic{'overlay_Y'}); + $window->resize($olMagic{'SsAppWin_Wdt'},$olMagic{'SsAppWin_Hgt'}); + } + } + + } +# OVERLAY MAGIC +###################################################################### +# Window Event stuff.... just in case we'd want to add more stuff... + sub windowEvent { - my ($mw, $event) = @_; -# print "E:",$event->type,":E\n"; -# print "S:",$event->state,":S\n"; -#if ($event->type eq "motion-notify") { -# print "S:",$event->state,":S\n"; - if ($event->state =~ /button\d\-mask/) { -# print "BUTTON DOWN LA!\n"; - $sstatusi{'dodgeMouse'} = time(); - $window->hide_all(); - } - # } + my ($mw, $event) = @_; + if ($event->state =~ /button\d\-mask/) { + doOverlayMagic('dodgemouse',1); + } } + ################################################################################################################################# # This sub, supposedly try to do a clean termination of the application... sub doSelfTerminate { - appDBugLog("Self Terminating............\n"); - if ($TnW{'timeoutRound'}) { - Glib::Source->remove($TnW{'timeoutRound'}); - } - $runSTATE = "T"; - mpCMD("quit"); - usleep(100000); - open(PS,"/bin/ps x --no-headers -o %u,%p,%n,%a|"); - while (my $psLine = <PS>) { - if (length($psLine) > 0) { - my ($user,$pid,$nice,$cmd) = split(/\,/,$psLine); - if ($cmd =~ /$SlaveFIFO/) { - appDBugLog("Trying to kill PID: $pid\n"); - kill("KILL",$pid); - } - } - } - close(PS); - - if (defined $LocalSocket){ - $LocalSocket->close; - $LocalSocket = undef; - } - - Gtk2->main_quit; - exit; - return FALSE; + $window->hide_all; + $runSTATE = "T"; + appDBugLog("Self Terminating............\n"); + mpCMD("quit"); + usleep(100000); + + if ($TnW{'timeoutRound'}) { + Glib::Source->remove($TnW{'timeoutRound'}); + } + + open(PS,"/bin/ps x --no-headers -o %u,%p,%n,%a|"); + while (my $psLine = <PS>) { + if (length($psLine) > 0) { + my ($user,$pid,$nice,$cmd) = split(/\,/,$psLine); + if ($cmd =~ /$SlaveFIFO/) { + my $cleanPID = sanitizer("num",$pid); + appDBugLog("Trying to kill PID: $cleanPID\n"); + kill("KILL",$cleanPID); + } + } + } + close(PS); + + if (defined $LocalSocket){ + $LocalSocket->close; + $LocalSocket = undef; + } + + Gtk2->main_quit; + exit; + return FALSE; + } # And this should be the very end of everything!? -################################################################################################################################# -############################################################################################################################################ ############################################################################################################################################## -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/mteleplayer.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch gzng in repository mteleplayer. commit b014e10e313a24e4cfcc944b891447c4d4726301 Author: gznget <opensource@gznianguan.com> Date: Fri Jul 4 06:43:31 2014 +0200 Test basic Id3v2 Album Art support audio files...(needs quite a bit more work) --- serverside/bin/mTPAArtExtractor | 17 +++++++++++++++++ serverside/bin/mteleplayer | 16 ++++++++++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/serverside/bin/mTPAArtExtractor b/serverside/bin/mTPAArtExtractor new file mode 100755 index 0000000..f73d5cc --- /dev/null +++ b/serverside/bin/mTPAArtExtractor @@ -0,0 +1,17 @@ +#!/usr/bin/perl + +my $inFile = @ARGV[0]; + +if (-f $inFile) { + my $pid = open(EXIF,"-|","/usr/bin/exiftool",'-PICTURE','-b',$inFile); + my @EXIF = <EXIF>; + close(EXIF); + + if (length("@EXIF") > 1000) { + my $outFile = $inFile; + $outFile =~ s/\.file\ *$//g; + open(CONV,"|-","/usr/bin/convert",'-','-resize','300x300',"$outFile.jpg"); + print CONV @EXIF; + close(CONV); + } +} diff --git a/serverside/bin/mteleplayer b/serverside/bin/mteleplayer index 586c73f..0262819 100755 --- a/serverside/bin/mteleplayer +++ b/serverside/bin/mteleplayer @@ -526,7 +526,16 @@ sub handleTheLocalSocket { if ($1 =~ /^ONLYAUDIO\|(\d)\|.*$/) { if ($1 eq 1) { $PlayerStatus{'OnylAudio'} = 1; - $GTKS{'MainMediaEBOXGFX'}->set_from_pixbuf($GTKS{'PixBUF'}{'musicalNote'}); + my $remoteDir = sanitizeDirPath("$X2GoTKSHome/remote/appData/mteleplayer\_$selfSID"); +print "$remoteDir/$PlayerStatus{'currentMediaID'}.jpg\n"; + if (-f "$remoteDir/$PlayerStatus{'currentMediaID'}.jpg") { + my $AlbumArt = Gtk2::Gdk::Pixbuf->new_from_file("$remoteDir/$PlayerStatus{'currentMediaID'}.jpg") or appDBugLog("Unable to load '$remoteDir/$PlayerStatus{'currentMediaID'}.jpg' to PixBUF... Is it even a GFX file?"); + if ($AlbumArt) { + $GTKS{'MainMediaEBOXGFX'}->set_from_pixbuf($AlbumArt); + } + } else { + $GTKS{'MainMediaEBOXGFX'}->set_from_pixbuf($GTKS{'PixBUF'}{'musicalNote'}); + } } else { $PlayerStatus{'OnylAudio'} = 0; $GTKS{'MainMediaEBOXGFX'}->set_from_pixbuf($GTKS{'PixBUF'}{'eyesore'}); @@ -772,7 +781,10 @@ sub mtpTeKiRemoteFileSetup { unless (-l "$remoteDir/$uniqueFileID.file") { # And in the insanely unlikely event that it happends again.. fk it... symlink($AbsoluteMediaFilePath,"$remoteDir/$uniqueFileID.file"); # Later maybe create a <SAME_UNIQUEID>.info file that cointains Title and other stuff that can make the GUI info etc pre load and look smoother.... - if (-l "$remoteDir/$uniqueFileID.file") { + if (-l "$remoteDir/$uniqueFileID.file") { + if (($AorV eq "A") and (-x "/usr/bin/mTPAArtExtractor")) { + system("/usr/bin/mTPAArtExtractor $remoteDir/$uniqueFileID.file &"); + } return $uniqueFileID; } else {return 0;} } -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/mteleplayer.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch gzng in repository mteleplayer. commit 2fa16599c1c62c76df61f0a4b8fc4f39c8a77f03 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Jul 4 09:42:11 2014 +0200 mTPAArtExtractor: Add license header. --- serverside/bin/mTPAArtExtractor | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/serverside/bin/mTPAArtExtractor b/serverside/bin/mTPAArtExtractor index f73d5cc..4443762 100755 --- a/serverside/bin/mTPAArtExtractor +++ b/serverside/bin/mTPAArtExtractor @@ -1,5 +1,33 @@ #!/usr/bin/perl +# mTelePlayer - A situation aware mediaplayer for the X2Go Terminal System. +# Copyright (C) 2013-2014 Guangzhou Nianguan Electronics Technology Co.Ltd. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the +# Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. +# +# +# Copyright (C) 2013-2014 Guangzhou Nianguan Electronics Technology Co.Ltd. +# Guangzhou Nianguan Electronics Technology Co.Ltd. +# Jin Fu Building , #90 QiFuRoad, +# Guangzhou, Guangdong, +# People's Republic of China +# +# Web: http://opensource.gznianguan.com/ +# E-mail: <opensource@gznianguan.com> + my $inFile = @ARGV[0]; if (-f $inFile) { -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/mteleplayer.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch gzng in repository mteleplayer. commit ff58aead359d4dc2c0a50c894cc67073ee7e28f0 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Jul 4 09:42:41 2014 +0200 move libAArtExtractor to lib/ rather then bin/ --- serverside/bin/mteleplayer | 5 +++-- .../applications/mteleplayer}/mTPAArtExtractor | 0 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/serverside/bin/mteleplayer b/serverside/bin/mteleplayer index 0262819..046f677 100755 --- a/serverside/bin/mteleplayer +++ b/serverside/bin/mteleplayer @@ -57,6 +57,7 @@ use Data::Dumper; # Do directory stuff here our %TeKiPaths = getTeKiPaths("S"); our $theSHAREDIR = sanitizeDirPath("$TeKiPaths{'SHARE'}/server/applications/mteleplayer") or die("NO SHARE DIR?"); +our $theLIBDIR = sanitizeDirPath("$TeKiPaths{'LIB'}/server/applications/mteleplayer") or die("NO LIB DIR?"); # Do directory stuff here ######################################################################################################## @@ -782,8 +783,8 @@ sub mtpTeKiRemoteFileSetup { symlink($AbsoluteMediaFilePath,"$remoteDir/$uniqueFileID.file"); # Later maybe create a <SAME_UNIQUEID>.info file that cointains Title and other stuff that can make the GUI info etc pre load and look smoother.... if (-l "$remoteDir/$uniqueFileID.file") { - if (($AorV eq "A") and (-x "/usr/bin/mTPAArtExtractor")) { - system("/usr/bin/mTPAArtExtractor $remoteDir/$uniqueFileID.file &"); + if (($AorV eq "A") and (-x "$theLIBDIR/mTPAArtExtractor")) { + system("$theLIBDIR/mTPAArtExtractor" $remoteDir/$uniqueFileID.file &"); } return $uniqueFileID; } else {return 0;} diff --git a/serverside/bin/mTPAArtExtractor b/serverside/lib/telekinesis/server/applications/mteleplayer/mTPAArtExtractor similarity index 100% rename from serverside/bin/mTPAArtExtractor rename to serverside/lib/telekinesis/server/applications/mteleplayer/mTPAArtExtractor -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/mteleplayer.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch gzng in repository mteleplayer. commit bb13be3aef960ee7b7fe56aa035ae57bab043a86 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Jul 4 09:55:24 2014 +0200 debian/control: Package mTPAArtExtractor in a separate bin:package --- debian/control | 25 +++++++++++++++++++++++++ debian/mteleplayer-albumart.install | 1 + 2 files changed, 26 insertions(+) diff --git a/debian/control b/debian/control index 45f1a46..deacc6a 100644 --- a/debian/control +++ b/debian/control @@ -19,6 +19,8 @@ Depends: telekinesis-server, libx2go-telekinesis-apps-perl, mplayer2, +Recommends: + mteleplayer-albumart, Description: Media player for X2Go X2Go is a server based computing environment with - session resuming @@ -34,6 +36,29 @@ Description: Media player for X2Go This package provides the mTelePlayer GUI and it should be installed on the X2Go Server machine. +Package: mteleplayer-albumart +Architecture: all +Depends: + ${misc:Depends}, + imagemagick, + libimage-exiftool-perl, + mteleplayer (>= ${source:Version}), mteleplayer (<< ${source:Version}.1~), +Description: Media player for X2Go + X2Go is a server based computing environment with + - session resuming + - low bandwidth support + - session brokerage support + - client side mass storage mounting support + - audio support + - authentication by smartcard and USB stick + . + mTelePlayer is a situation aware mediaplayer for the X2Go + Terminal System. + . + This package provides an add-on for the mTelePlayer GUI + that facilitates image analysis and conversion for downloaded + album covers (when playing audio files). + Package: mteleplayer-clientside Architecture: all Depends: diff --git a/debian/mteleplayer-albumart.install b/debian/mteleplayer-albumart.install new file mode 100644 index 0000000..79c0e48 --- /dev/null +++ b/debian/mteleplayer-albumart.install @@ -0,0 +1 @@ +serverside/lib/telekinesis/server/applications/mteleplayer/mTPAArtExtractor usr/lib/telekinesis/server/applications/mteleplayer/ -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/mteleplayer.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch gzng in repository mteleplayer. commit 12bdd2eea9f5fc28d85364987a69d0836bba65f5 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Jul 4 10:44:33 2014 +0200 typo fix --- serverside/bin/mteleplayer | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/serverside/bin/mteleplayer b/serverside/bin/mteleplayer index 046f677..8b9aed2 100755 --- a/serverside/bin/mteleplayer +++ b/serverside/bin/mteleplayer @@ -784,7 +784,7 @@ sub mtpTeKiRemoteFileSetup { # Later maybe create a <SAME_UNIQUEID>.info file that cointains Title and other stuff that can make the GUI info etc pre load and look smoother.... if (-l "$remoteDir/$uniqueFileID.file") { if (($AorV eq "A") and (-x "$theLIBDIR/mTPAArtExtractor")) { - system("$theLIBDIR/mTPAArtExtractor" $remoteDir/$uniqueFileID.file &"); + system("$theLIBDIR/mTPAArtExtractor $remoteDir/$uniqueFileID.file &"); } return $uniqueFileID; } else {return 0;} -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/mteleplayer.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch gzng in repository mteleplayer. commit 860ff61297c56240a7adb9928e7ca11dadf3fe27 Author: gznget <opensource@gznianguan.com> Date: Fri Jul 4 12:27:13 2014 +0200 Adding some visibility test stuff --- .../mteleplayer/bin/mteleplayer_clientside | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/clientside/lib/telekinesis/client/applications/mteleplayer/bin/mteleplayer_clientside b/clientside/lib/telekinesis/client/applications/mteleplayer/bin/mteleplayer_clientside index 0ddb134..3153eab 100755 --- a/clientside/lib/telekinesis/client/applications/mteleplayer/bin/mteleplayer_clientside +++ b/clientside/lib/telekinesis/client/applications/mteleplayer/bin/mteleplayer_clientside @@ -535,6 +535,8 @@ sub doOverlayMagic { my $reTogVis = 0; my $changePos = 0; if ($doWHAT eq "init") { + $olMagic{'dodgeMouse'} = 0; + $olMagic{'CsSesWin_FS'} = 0; $olMagic{'CsSesWin_Vis'} = 0; $olMagic{'CsSesWin_aX'} = 0; @@ -654,8 +656,7 @@ sub doOverlayMagic { } - - + appDBugLog("OVIS: $olMagic{'dodgeMouse'} $olMagic{'onlyaudio'} $olMagic{'SsAppWin_Vis'} $olMagic{'CsSesWin_Vis'} ($olMagic{'visible'})"); if (($changeVis eq 1) or ($reTogVis eq 1)) { if ($olMagic{'visible'} eq 0) { -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/mteleplayer.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch gzng in repository mteleplayer. commit df8397462d0f93543866e6d667fe3d73b663ee1d Author: gznget <opensource@gznianguan.com> Date: Fri Jul 4 15:02:17 2014 +0200 Adding some more visibility test stuff and maybe a FIX --- .../mteleplayer/bin/mteleplayer_clientside | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/clientside/lib/telekinesis/client/applications/mteleplayer/bin/mteleplayer_clientside b/clientside/lib/telekinesis/client/applications/mteleplayer/bin/mteleplayer_clientside index 3153eab..05e54b0 100755 --- a/clientside/lib/telekinesis/client/applications/mteleplayer/bin/mteleplayer_clientside +++ b/clientside/lib/telekinesis/client/applications/mteleplayer/bin/mteleplayer_clientside @@ -437,9 +437,11 @@ sub watch_mplayerOutput { ############################# } elsif ($line =~ /^Playing(.*)$/) { appDBugLog("Playing: $1"); - } elsif (($line =~ /======================================/) and ($mediaINFO{'MEDIAINFOSET'} ne 1)) { - appDBugLog("SET MEDIAINFO TRIG 1!"); - setMediaInfo(1);# Trigger setMediaInfo DONE... + } elsif (($line =~ /======================================/) or ($line =~ /Starting playback\.\.\./)) { + if ($mediaINFO{'MEDIAINFOSET'} ne 1) { + appDBugLog("SET MEDIAINFO TRIG 1!"); + setMediaInfo(1);# Trigger setMediaInfo DONE... + } } elsif ($line =~ /^ANS\_FILENAME\=\'(.*)\'$/) { $mpState{'mediaFileName'} = $1; } elsif ($line =~ /^Cache fill:([\ \d\.\%]*)\((\d*) bytes\)/) { -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/mteleplayer.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch gzng in repository mteleplayer. commit d899ad0388d70f5a9c93d9a02dce8aaa5ef82e42 Author: gznget <opensource@gznianguan.com> Date: Sat Jul 5 16:53:08 2014 +0200 minor gfx change --- .../server/applications/mteleplayer/splash320.png | Bin 11949 -> 11626 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/serverside/share/telekinesis/server/applications/mteleplayer/splash320.png b/serverside/share/telekinesis/server/applications/mteleplayer/splash320.png index 66b3a15..638c8af 100644 Binary files a/serverside/share/telekinesis/server/applications/mteleplayer/splash320.png and b/serverside/share/telekinesis/server/applications/mteleplayer/splash320.png differ -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/mteleplayer.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch gzng in repository mteleplayer. commit 52b69428e11a7d58f85cb01e132e6b8f05601009 Author: gznget <opensource@gznianguan.com> Date: Fri Aug 29 06:25:58 2014 +0200 Relaxing some timeout limits to prevent premature selfdestruction on slow connections --- .../mteleplayer/bin/mteleplayer_clientside | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clientside/lib/telekinesis/client/applications/mteleplayer/bin/mteleplayer_clientside b/clientside/lib/telekinesis/client/applications/mteleplayer/bin/mteleplayer_clientside index c9580bd..945030c 100755 --- a/clientside/lib/telekinesis/client/applications/mteleplayer/bin/mteleplayer_clientside +++ b/clientside/lib/telekinesis/client/applications/mteleplayer/bin/mteleplayer_clientside @@ -166,7 +166,7 @@ $window->show_all(); &do_mplayer; doOverlayMagic('init'); -$TnW{'timeoutRound'} = Glib::Timeout->add (1000, sub {appCOM("YO!");if ($sstatusi{'lastCOMtime'} < (time()-4)) {&doSelfTerminate;}1;}); +$TnW{'timeoutRound'} = Glib::Timeout->add (1000, sub {appCOM("YO!");if ($sstatusi{'lastCOMtime'} < (time()-8)) {&doSelfTerminate;}1;}); $TnW{'transglitcpresistance'} = Glib::Timeout->add(100, \&connectionPresistance); $TnW{'mouseDeDodger'} = Glib::Timeout->add(100, sub {if ($olMagic{'dodgeMouse'} eq 1) {doOverlayMagic('dodgemouse',0);}1;}); -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/mteleplayer.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch gzng in repository mteleplayer. commit deff486f8645026e425f11e43eec470066ceb966 Author: gznget <opensource@gznianguan.com> Date: Fri Aug 29 06:28:09 2014 +0200 Relaxing some timeout limits to prevent premature selfdestruction on slow connections --- serverside/bin/mteleplayer | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/serverside/bin/mteleplayer b/serverside/bin/mteleplayer index 8b9aed2..4b9b2db 100755 --- a/serverside/bin/mteleplayer +++ b/serverside/bin/mteleplayer @@ -158,7 +158,7 @@ $TnW{'runstatechanges'} = Glib::Timeout->add (100, \&coreRunSTATEchanges); #my $randomcrap = Glib::Timeout->add (250, sub {if(($sstatusi{'runState'} eq "R") and ($sstatusi{'sockState'} > 0) and ($sstatusi{'X2GoResized'} > 0)){ # $sstatusi{'X2GoResized'}--; checkDimPosNSend(1);} 1;}); my $randomcrap = Glib::Timeout->add (150, sub {if(($sstatusi{'runState'} eq "R") and ($sstatusi{'sockState'} > 0)) { - if ($sstatusi{'lastCOMtime'} < (time()-2)) {toggleBLACKOUT(1);} else { + if ($sstatusi{'lastCOMtime'} < (time()-10)) {toggleBLACKOUT(1);} else { checkDimPosNSend(); } } 1;}); @@ -599,7 +599,6 @@ print "$remoteDir/$PlayerStatus{'currentMediaID'}.jpg\n"; $fh->close; $fh = undef; $sstatusi{'sockState'} = 0; - Gtk2->main_iteration while Gtk2->events_pending; return 0; } -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/mteleplayer.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch gzng in repository mteleplayer. commit 9bc734e673ed10abd324298c538dc3da7475df45 Author: gznget <opensource@gznianguan.com> Date: Tue Jul 8 06:03:31 2014 +0200 . --- .../applications/mteleplayer/mTPAArtExtractor | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/serverside/lib/telekinesis/server/applications/mteleplayer/mTPAArtExtractor b/serverside/lib/telekinesis/server/applications/mteleplayer/mTPAArtExtractor index 9beb5d3..0551f17 100755 --- a/serverside/lib/telekinesis/server/applications/mteleplayer/mTPAArtExtractor +++ b/serverside/lib/telekinesis/server/applications/mteleplayer/mTPAArtExtractor @@ -29,8 +29,8 @@ # E-mail: <opensource@gznianguan.com> ############################################################################### # -# This will soon be replaced with a sligthly better/cleaner script... -# But for now it works fairly ok...? +# This will soon be replaced with a sligthly better/cleaner script. +# But for now it works fairly ok. # ############################################################################### my $inFile = @ARGV[0]; -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/mteleplayer.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch gzng in repository mteleplayer. commit 26a801f33b9e02ee873b6fa55f15b796df94a6ab Author: gznget <opensource@gznianguan.com> Date: Thu Aug 28 13:12:02 2014 +0200 Fix dancing numbers and hopefully some olMagic visibility issues --- .../mteleplayer/bin/mteleplayer_clientside | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/clientside/lib/telekinesis/client/applications/mteleplayer/bin/mteleplayer_clientside b/clientside/lib/telekinesis/client/applications/mteleplayer/bin/mteleplayer_clientside index 05e54b0..bb556d0 100755 --- a/clientside/lib/telekinesis/client/applications/mteleplayer/bin/mteleplayer_clientside +++ b/clientside/lib/telekinesis/client/applications/mteleplayer/bin/mteleplayer_clientside @@ -166,7 +166,7 @@ $window->show_all(); &do_mplayer; doOverlayMagic('init'); -$TnW{'timeoutRound'} = Glib::Timeout->add (1000, sub {appCOM("YO!");if ($sstatusi{'lastCOMtime'} < (time()-2)) {&doSelfTerminate;}1;}); +$TnW{'timeoutRound'} = Glib::Timeout->add (1000, sub {appCOM("YO!");if ($sstatusi{'lastCOMtime'} < (time()-4)) {&doSelfTerminate;}1;}); $TnW{'transglitcpresistance'} = Glib::Timeout->add(100, \&connectionPresistance); $TnW{'mouseDeDodger'} = Glib::Timeout->add(100, sub {if ($olMagic{'dodgeMouse'} eq 1) {doOverlayMagic('dodgemouse',0);}1;}); @@ -456,8 +456,9 @@ sub watch_mplayerOutput { if ($line =~ /^A:[\ \.\d]*V:([\ \.\d]*)/) {$mpState{'mediaPos'} = $1;} elsif ($line =~ /^A:([\ \.\d]*)/) {$mpState{'mediaPos'} = $1;} elsif ($line =~ /^V:[\ ]*([\.\d]*[\ ]*)/) {$mpState{'mediaPos'} = $1;} - $mpState{'mediaPos'}++;$mpState{'mediaPos'}--; +# $mpState{'mediaPos'} =~ s/\ //g; my ($newSecond,undef) = split(/\./,$mpState{'mediaPos'}); + $newSecond =~ s/\D//g;$newSecond++;$newSecond--; if ($newSecond ne $mpState{'prevSecond'}) { $mpState{'prevSecond'} = $newSecond; doReportTimePos($newSecond,$mpState{'mediaLength'}); @@ -537,8 +538,6 @@ sub doOverlayMagic { my $reTogVis = 0; my $changePos = 0; if ($doWHAT eq "init") { - $olMagic{'dodgeMouse'} = 0; - $olMagic{'CsSesWin_FS'} = 0; $olMagic{'CsSesWin_Vis'} = 0; $olMagic{'CsSesWin_aX'} = 0; @@ -568,7 +567,7 @@ sub doOverlayMagic { } } elsif ($doWHAT eq "csseswin") { - +appDBugLog("WTF:$olMagic{'CsSesWin_FS'} ne $_[1]"); if ($olMagic{'CsSesWin_FS'} ne $_[1]) { if ($_[1] eq 1) { $olMagic{'CsSesWin_FS'} = 1; @@ -658,9 +657,11 @@ sub doOverlayMagic { } - appDBugLog("OVIS: $olMagic{'dodgeMouse'} $olMagic{'onlyaudio'} $olMagic{'SsAppWin_Vis'} $olMagic{'CsSesWin_Vis'} ($olMagic{'visible'})"); + + if (($changeVis eq 1) or ($reTogVis eq 1)) { + if ($olMagic{'visible'} eq 0) { if ($window->visible) { $window->hide_all; @@ -671,6 +672,9 @@ sub doOverlayMagic { $window->hide_all; } } + if ($olMagic{'CsSesWin_FS'} eq 1) { + usleep(200000); + } unless ($window->visible) { $window->move($olMagic{'overlay_X'},$olMagic{'overlay_Y'}); $window->resize($olMagic{'SsAppWin_Wdt'},$olMagic{'SsAppWin_Hgt'}); -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/mteleplayer.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch gzng in repository mteleplayer. commit 80c128df03b2ce0453d355b823e33659df5541ac Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Aug 28 16:11:23 2014 +0200 mteleplayer_clientside: Give the fullscreen going X2Go Agent window more time (1sec) to settle before raising the mplayer overlay again. --- .../mteleplayer/bin/mteleplayer_clientside | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clientside/lib/telekinesis/client/applications/mteleplayer/bin/mteleplayer_clientside b/clientside/lib/telekinesis/client/applications/mteleplayer/bin/mteleplayer_clientside index bb556d0..c9580bd 100755 --- a/clientside/lib/telekinesis/client/applications/mteleplayer/bin/mteleplayer_clientside +++ b/clientside/lib/telekinesis/client/applications/mteleplayer/bin/mteleplayer_clientside @@ -673,7 +673,7 @@ appDBugLog("WTF:$olMagic{'CsSesWin_FS'} ne $_[1]"); } } if ($olMagic{'CsSesWin_FS'} eq 1) { - usleep(200000); + usleep(1000000); } unless ($window->visible) { $window->move($olMagic{'overlay_X'},$olMagic{'overlay_Y'}); -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/mteleplayer.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch gzng in repository mteleplayer. commit f44fbbb015741830e38d0b7f771815c9ccb4028c Author: gznget <opensource@gznianguan.com> Date: Sun Jul 6 17:41:18 2014 +0200 ... --- .../applications/mteleplayer/mTPAArtExtractor | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/serverside/lib/telekinesis/server/applications/mteleplayer/mTPAArtExtractor b/serverside/lib/telekinesis/server/applications/mteleplayer/mTPAArtExtractor index 4443762..9beb5d3 100755 --- a/serverside/lib/telekinesis/server/applications/mteleplayer/mTPAArtExtractor +++ b/serverside/lib/telekinesis/server/applications/mteleplayer/mTPAArtExtractor @@ -27,7 +27,12 @@ # # Web: http://opensource.gznianguan.com/ # E-mail: <opensource@gznianguan.com> - +############################################################################### +# +# This will soon be replaced with a sligthly better/cleaner script... +# But for now it works fairly ok...? +# +############################################################################### my $inFile = @ARGV[0]; if (-f $inFile) { -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/mteleplayer.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch gzng in repository mteleplayer. commit 70dd645d18535d60d69f08e51d14d4974d5430de Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Aug 29 21:11:11 2014 +0200 mTP GUI: use gtk_window_present() instead of gtk_window_deiconify/_iconify. This is more reliable.~ --- serverside/bin/mteleplayer | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/serverside/bin/mteleplayer b/serverside/bin/mteleplayer index 4b9b2db..9959e16 100755 --- a/serverside/bin/mteleplayer +++ b/serverside/bin/mteleplayer @@ -512,7 +512,7 @@ sub handleTheLocalSocket { appDBugLog("##################### REINIT MTP ########################"); $sstatusi{'runState'} = "R"; print $LocalSocket "APP|RESUME|mteleplayer|$selfSID|\n"; - $GTKS{'MainAppWindow'}->iconify;$GTKS{'MainAppWindow'}->deiconify; + $GTKS{'MainAppWindow'}->present; stateChangePAUSED(0); } @@ -726,8 +726,7 @@ sub actOnEnqueuedMEDIA { $PlayerStatus{'currentMediaSeek'} = 0; appCOM("MPCMD|PLAYMEDIA|$1|FILE|0|0|"); if ($_[2] eq 1) { - $GTKS{'MainAppWindow'}->iconify; - $GTKS{'MainAppWindow'}->deiconify; + $GTKS{'MainAppWindow'}->present; } } $GTKS{'MainMediaEBOXGFX'}->set_from_pixbuf($GTKS{'PixBUF'}{'eyesore'}); -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/mteleplayer.git