diff --git a/app/src/gambas3/.lang/.pot b/app/src/gambas3/.lang/.pot index b9cade78f..6aaabf3e2 100644 --- a/app/src/gambas3/.lang/.pot +++ b/app/src/gambas3/.lang/.pot @@ -548,7 +548,7 @@ msgstr "" #: FReportPaddingChooser.form:75 FSave.form:28 FSaveProjectAs.form:76 #: FSearch.class:869 FSelectExtraFile.form:43 FSelectIcon.form:87 #: FSnippet.form:57 FTableChooser.form:68 FText.form:41 FTextEditor.class:599 -#: FTranslate.class:552 Project.module:469 +#: FTranslate.class:554 Project.module:469 msgid "Cancel" msgstr "" @@ -618,21 +618,21 @@ msgstr "" msgid "in &1:&2." msgstr "" -#: Design.module:355 +#: Design.module:357 msgid "The program has stopped unexpectedly:" msgstr "" -#: Design.module:355 +#: Design.module:357 msgid "Please send a bug report to the following mail address: &1" msgstr "" -#: Design.module:359 +#: Design.module:361 msgid "" "The program has returned\n" "the value: &1" msgstr "" -#: Design.module:420 FColorChooser.form:54 FConnectionEditor.class:452 +#: Design.module:422 FColorChooser.form:54 FConnectionEditor.class:452 #: FCreateFile.form:443 FFieldChooser.form:132 FFontChooser.form:34 #: FGotoLine.form:17 FInfo.form:172 FList.form:115 FMain.class:1824 #: FMakeInstall.class:299 FMenu.form:372 FNewConnection.form:249 @@ -645,11 +645,11 @@ msgstr "" msgid "OK" msgstr "" -#: Design.module:841 +#: Design.module:843 msgid "Output terminal" msgstr "" -#: Design.module:868 +#: Design.module:870 msgid "No terminal emulator found." msgstr "" @@ -830,7 +830,7 @@ msgstr "" #: FConnectionEditor.form:108 FEditor.form:317 FForm.form:417 #: FHelpBrowser.form:67 FIconEditor.form:79 FImageEditor.form:62 -#: FTextEditor.form:231 FTranslate.class:648 +#: FTextEditor.form:231 FTranslate.class:650 msgid "Reload" msgstr "" @@ -927,7 +927,7 @@ msgid "Export..." msgstr "" #: FConnectionEditor.form:460 FForm.form:268 FMain.class:211 -#: FNewConnection.class:325 FOption.class:857 FTranslate.class:552 +#: FNewConnection.class:325 FOption.class:857 FTranslate.class:554 msgid "Delete" msgstr "" @@ -1068,7 +1068,7 @@ msgstr "" msgid "CSV files" msgstr "" -#: FConnectionEditor.class:1421 FTranslate.class:1196 +#: FConnectionEditor.class:1421 FTranslate.class:1198 msgid "All files" msgstr "" @@ -1408,7 +1408,7 @@ msgstr "" msgid "Show search window" msgstr "" -#: FDebugInfo.form:324 FSearch.class:486 FTranslate.class:514 +#: FDebugInfo.form:324 FSearch.class:486 FTranslate.class:516 msgid "Search string cannot be found." msgstr "" @@ -3037,7 +3037,7 @@ msgid "There is no CHANGELOG entry for this release." msgstr "" #: FMakeInstall.class:350 FProjectVersion.class:201 FSave.form:21 -#: Project.module:3261 +#: Project.module:3259 msgid "Continue" msgstr "" @@ -3143,7 +3143,7 @@ msgstr "" msgid "*.gz;*.bz2;*.xz" msgstr "" -#: FMakePatch.form:89 Project.module:4312 +#: FMakePatch.form:89 Project.module:4310 msgid "Source packages" msgstr "" @@ -3219,7 +3219,7 @@ msgstr "" msgid "This menu is too deep !" msgstr "" -#: FMenu.class:937 Project.module:5111 +#: FMenu.class:937 Project.module:5109 msgid "modified" msgstr "" @@ -3964,7 +3964,7 @@ msgstr "" msgid "Snapping value is incorrect." msgstr "" -#: FProjectProperty.class:408 Project.module:3260 +#: FProjectProperty.class:408 Project.module:3258 msgid "Some components are missing: &1" msgstr "" @@ -4560,63 +4560,63 @@ msgstr "" msgid "Cannot read translation file for language '&1'" msgstr "" -#: FTranslate.class:442 +#: FTranslate.class:444 msgid "Cannot save translation." msgstr "" -#: FTranslate.class:552 +#: FTranslate.class:554 msgid "Do you really want to delete this translation ?" msgstr "" -#: FTranslate.class:648 +#: FTranslate.class:650 msgid "Do you really want to reload this translation ?" msgstr "" -#: FTranslate.class:662 +#: FTranslate.class:664 msgid "Export a translation" msgstr "" -#: FTranslate.class:847 +#: FTranslate.class:849 msgid "Please select the translation file to import." msgstr "" -#: FTranslate.class:885 +#: FTranslate.class:887 msgid "No translation were picked up." msgstr "" -#: FTranslate.class:887 +#: FTranslate.class:889 msgid "One translation was picked up." msgstr "" -#: FTranslate.class:889 +#: FTranslate.class:891 msgid "&1 translations were picked up." msgstr "" -#: FTranslate.class:897 +#: FTranslate.class:899 msgid "Cannot import translation file." msgstr "" -#: FTranslate.class:946 +#: FTranslate.class:948 msgid "Translated string symbols do not match untranslated string ones." msgstr "" -#: FTranslate.class:959 +#: FTranslate.class:961 msgid "Everything seems to be correct." msgstr "" -#: FTranslate.class:982 +#: FTranslate.class:984 msgid "&1 strings. Everything is translated!" msgstr "" -#: FTranslate.class:984 +#: FTranslate.class:986 msgid "&1 strings. One is not translated. &3% done." msgstr "" -#: FTranslate.class:986 +#: FTranslate.class:988 msgid "&1 strings. &2 are not translated. &3% done." msgstr "" -#: FTranslate.class:1111 Project.module:4277 +#: FTranslate.class:1113 Project.module:4275 msgid "The '&1' command has failed." msgstr "" @@ -6241,150 +6241,150 @@ msgstr "" msgid "in &1." msgstr "" -#: Project.module:2331 +#: Project.module:2329 msgid "" "Some project source files are in conflict.\n" "Please solve them if you want to compile the project." msgstr "" -#: Project.module:2335 +#: Project.module:2333 msgid "Compiling project" msgstr "" -#: Project.module:2576 +#: Project.module:2574 msgid "File already exists." msgstr "" -#: Project.module:2608 +#: Project.module:2606 msgid "Directory already exists." msgstr "" -#: Project.module:2620 +#: Project.module:2618 msgid "Cannot link template file." msgstr "" -#: Project.module:2626 +#: Project.module:2624 msgid "Cannot copy template file." msgstr "" -#: Project.module:2836 +#: Project.module:2834 msgid "Making executable..." msgstr "" -#: Project.module:2880 +#: Project.module:2878 msgid "Cannot make executable." msgstr "" -#: Project.module:3450 +#: Project.module:3448 msgid "Cannot write project file." msgstr "" -#: Project.module:3492 +#: Project.module:3490 msgid "Unable to create desktop shortcut." msgstr "" -#: Project.module:3738 +#: Project.module:3736 msgid "The directory will be removed at the next commit." msgstr "" -#: Project.module:3755 +#: Project.module:3753 msgid "You must define a startup class or form!" msgstr "" -#: Project.module:3786 +#: Project.module:3784 msgid "Please type a name." msgstr "" -#: Project.module:3790 +#: Project.module:3788 msgid "This name contains a forbidden character:" msgstr "" -#: Project.module:3794 +#: Project.module:3792 msgid "The name cannot begins with a dot." msgstr "" -#: Project.module:3798 +#: Project.module:3796 msgid "This name is already used. Choose another one." msgstr "" -#: Project.module:3834 +#: Project.module:3832 msgid "" "A class name must begin with a letter or an underscore, followed by any " "letter or digit." msgstr "" -#: Project.module:3882 +#: Project.module:3880 msgid "Destination already exists." msgstr "" -#: Project.module:4094 +#: Project.module:4092 msgid "Unable to rename '&1'" msgstr "" -#: Project.module:4210 +#: Project.module:4208 msgid "Please type a project name." msgstr "" -#: Project.module:4218 +#: Project.module:4216 msgid "The project name cannot begin with a dot." msgstr "" -#: Project.module:4221 +#: Project.module:4219 msgid "Non-ASCII characters are forbidden in a project name." msgstr "" -#: Project.module:4222 +#: Project.module:4220 msgid "" "The following characters are forbidden in a project name: ? * / \\ SPACE" msgstr "" -#: Project.module:4229 +#: Project.module:4227 msgid "This project already exists." msgstr "" -#: Project.module:4232 +#: Project.module:4230 msgid "The project directory already exists." msgstr "" -#: Project.module:4234 +#: Project.module:4232 msgid "" "The project directory cannot be created because a file with the same name " "already exists." msgstr "" -#: Project.module:4288 +#: Project.module:4286 msgid "Unable to create source archive." msgstr "" -#: Project.module:4311 +#: Project.module:4309 msgid "Create source package" msgstr "" -#: Project.module:4603 +#: Project.module:4601 msgid "Cannot copy file &1." msgstr "" -#: Project.module:4651 +#: Project.module:4649 msgid "Cannot create link &1." msgstr "" -#: Project.module:4666 +#: Project.module:4664 msgid "Cannot move a directory inside itself." msgstr "" -#: Project.module:4734 +#: Project.module:4732 msgid "Cannot move file &1." msgstr "" -#: Project.module:5264 +#: Project.module:5262 msgid "Project cleanup..." msgstr "" -#: Project.module:5270 +#: Project.module:5268 msgid "Project files conversion..." msgstr "" -#: Project.module:5300 +#: Project.module:5298 msgid "Unable to convert &1" msgstr "" diff --git a/app/src/gambas3/.src/Debug/Design.module b/app/src/gambas3/.src/Debug/Design.module index 9ceb752d3..b49bf5600 100644 --- a/app/src/gambas3/.src/Debug/Design.module +++ b/app/src/gambas3/.src/Debug/Design.module @@ -348,6 +348,8 @@ Public Sub Process_Kill() 'PRINT "KILL" If Not Project.AboutToQuit Then AfterStop + + If Not $hProcess Then Return ' $hProcess may be NULL if the event loop is called somewhere during AfterStop() If $hProcess.State = Process.Crashed Then ' SIGKILL and SIGTERM are not considered as bugs in the program diff --git a/app/src/gambas3/.src/Project.module b/app/src/gambas3/.src/Project.module index 5ef0a6426..ab89334fa 100644 --- a/app/src/gambas3/.src/Project.module +++ b/app/src/gambas3/.src/Project.module @@ -2287,14 +2287,12 @@ Public Function GetCompileCommand(bAll As Boolean, bNoDebug As Boolean, bMakeExe End -Private Sub CreateLangDirectory() +Public Sub CreateLangDirectory() Dim sDir As String = Project.Dir &/ ".lang" - If Not Exist(sDir) Then - Mkdir sDir - VersionControl.AddDir(sDir) - Endif + Try Mkdir sDir + If IsDir(sDir) And If Dir(sDir).Count = 0 Then VersionControl.AddDir(sDir) End diff --git a/app/src/gambas3/.src/Translation/FTranslate.class b/app/src/gambas3/.src/Translation/FTranslate.class index 6964c68b0..d85f269bd 100644 --- a/app/src/gambas3/.src/Translation/FTranslate.class +++ b/app/src/gambas3/.src/Translation/FTranslate.class @@ -388,6 +388,8 @@ Private Sub SaveTranslate(Optional bForce As Boolean) UpdateOrg() + Project.CreateLangDirectory() + sPathMO = Left$($sPath, -3) & ".mo" bExistMO = Exist(sPathMO) diff --git a/examples/examples/Multimedia/MediaPlayer/.lang/fr.mo b/examples/examples/Multimedia/MediaPlayer/.lang/fr.mo new file mode 100644 index 000000000..0bed9f906 Binary files /dev/null and b/examples/examples/Multimedia/MediaPlayer/.lang/fr.mo differ diff --git a/examples/examples/Multimedia/MediaPlayer/.lang/fr.po b/examples/examples/Multimedia/MediaPlayer/.lang/fr.po new file mode 100644 index 000000000..c2de5999c --- /dev/null +++ b/examples/examples/Multimedia/MediaPlayer/.lang/fr.po @@ -0,0 +1,64 @@ +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2002-11-01 04:27+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: .project:1 +msgid "Media player based on GStreamer" +msgstr "" + +#: .project:2 +msgid "This example is a demonstration of how to use GStreamer with Gambas to play any sound or video file." +msgstr "" + +#: FControl.form:39 +msgid "MediaPlayer, a media player example based on GStreamer made by Benoît Minisini" +msgstr "MediaPlayer, un exemple de lecteur multimedia basé sur GStreamer programmé par Benoît Minisini" + +#: FMain.class:141 +msgid "Select a media file" +msgstr "Choisissez un fichier son ou vidéo" + +#: FMain.class:160 FTags.form:110 +msgid "Video device" +msgstr "Périphérique video" + +#: FMain.class:185 +msgid "Select a subtitle file" +msgstr "Choisissez un fichier de sous-titres" + +#: FTags.class:12 +msgid "Hue" +msgstr "Teinte" + +#: FTags.class:14 +msgid "Saturation" +msgstr "Saturation" + +#: FTags.class:16 +msgid "Contrast" +msgstr "Contraste" + +#: FTags.class:18 +msgid "Brightness" +msgstr "Luminosité" + +#: FTags.class:109 +msgid "No video device" +msgstr "Aucun périphérique video" + +#: FTags.form:45 +msgid "Information" +msgstr "Information" + +#: FTags.form:78 +msgid "Balance" +msgstr "Balance" diff --git a/examples/examples/Multimedia/MediaPlayer/.project b/examples/examples/Multimedia/MediaPlayer/.project index 69c4d9c47..28e8759af 100644 --- a/examples/examples/Multimedia/MediaPlayer/.project +++ b/examples/examples/Multimedia/MediaPlayer/.project @@ -15,4 +15,6 @@ Component=gb.media Description="This example is a demonstration of how to use GStreamer with Gambas to play any sound or video file." Environment="GB_GUI=gb.qt4" TabSize=2 +Translate=1 +Language=en Packager=1 diff --git a/examples/examples/Multimedia/MediaPlayer/.src/FControl.class b/examples/examples/Multimedia/MediaPlayer/.src/FControl.class index 84f0f7747..93b4d6e5e 100644 --- a/examples/examples/Multimedia/MediaPlayer/.src/FControl.class +++ b/examples/examples/Multimedia/MediaPlayer/.src/FControl.class @@ -21,7 +21,7 @@ Public Sub _new() panToolbar.H = 48 + Desktop.Scale * 2 - FMain.CreateButtons(["eject", "video", "info", "play", "pause", "stop", "screenshot", "fullscreen", "subtitle", "visualisation", "-"], panToolbar) + FMain.CreateButtons(["eject", "video", "config", "play", "pause", "stop", "screenshot", "fullscreen", "subtitle", "visualisation", "-"], panToolbar) sldTime = New DrawingArea(panToolbar) As "sldTime" sldTime.Resize(8, 8) diff --git a/examples/examples/Multimedia/MediaPlayer/.src/FMain.class b/examples/examples/Multimedia/MediaPlayer/.src/FMain.class index 34ebc5a36..a7217dac6 100644 --- a/examples/examples/Multimedia/MediaPlayer/.src/FMain.class +++ b/examples/examples/Multimedia/MediaPlayer/.src/FMain.class @@ -133,6 +133,7 @@ Private Sub Action(sAction As String) Dim iState As Integer Dim sName As String Dim iName As Integer + Dim sVideo As String Select sAction @@ -154,14 +155,17 @@ Private Sub Action(sAction As String) Case "video" - FControl.SetTitle("v4l2:///dev/video0") - Action("stop") - $hPlayer.Subtitles.Enabled = False - $hPlayer.URL = "v4l2:///dev/video0" - FTags.Clear($hPlayer) - Action("play") + sVideo = FTags.GetVideoDevice() + If sVideo Then + FControl.SetTitle(("Video device") & " " & sVideo) + Action("stop") + $hPlayer.Subtitles.Enabled = False + $hPlayer.URL = "v4l2://" & sVideo + FTags.Clear($hPlayer) + Action("play") + Endif - Case "info" + Case "info", "config" If $bShowTags Then CAnimation.Start(FTags, "Opacity", 0, 250, Me) 'CAnimation.Start(Me, "TagsX", - FTags.W, 250) diff --git a/examples/examples/Multimedia/MediaPlayer/.src/FTags.class b/examples/examples/Multimedia/MediaPlayer/.src/FTags.class index fb34ce745..fd164d314 100644 --- a/examples/examples/Multimedia/MediaPlayer/.src/FTags.class +++ b/examples/examples/Multimedia/MediaPlayer/.src/FTags.class @@ -39,8 +39,6 @@ Public Sub Clear(hPlayer As MediaPlayer) With hPlayer.Balance[I] - Print .Name; ": "; .Min;; .Max;; .Value - hLabel = New Label(panBalance) hLabel.Text = GetBalanceName(.Name) hLabel.Foreground = lblBalance.Foreground @@ -94,12 +92,24 @@ End Public Sub _new() + Dim sFile As String + gvwTags.Columns.Count = 2 btnResetBalance = New CButton(panLabel) As "btnResetBalance" btnResetBalance.Resize(panLabel.H, panLabel.H) btnResetBalance.Image = Image.Load("undo.png") + cmbVideoDevice.Clear + If Exist("/sys/class/video4linux") Then + For Each sFile In Dir("/sys/class/video4linux") + cmbVideoDevice.Add("/dev" &/ sFile) + Next + Else + cmbVideoDevice.Add(("No video device")) + cmbVideoDevice.Enabled = False + Endif + End Public Sub Form_Resize() @@ -128,3 +138,10 @@ Public Sub btnResetBalance_Click() Next End + +Public Sub GetVideoDevice() As String + + If cmbVideoDevice.Enabled Then Return cmbVideoDevice.Text + +End + diff --git a/examples/examples/Multimedia/MediaPlayer/.src/FTags.form b/examples/examples/Multimedia/MediaPlayer/.src/FTags.form index 054953bdd..9b21d84a0 100644 --- a/examples/examples/Multimedia/MediaPlayer/.src/FTags.form +++ b/examples/examples/Multimedia/MediaPlayer/.src/FTags.form @@ -1,7 +1,7 @@ # Gambas Form File 3.0 { Form Form - MoveScaled(0,0,82,63) + MoveScaled(0,0,82,82) Background = &H3F3F3F& Resizable = False Border = False @@ -11,7 +11,7 @@ Spacing = True Margin = True { panTags Panel - MoveScaled(2,3,64,58) + MoveScaled(2,3,75,78) Background = &H000000& Arrangement = Arrange.Vertical { Panel2 VBox @@ -37,17 +37,17 @@ } } { Panel1 Panel - MoveScaled(4,31,18,1) + MoveScaled(2,31,18,1) Background = &H3F3F3F& } { VBox1 VBox - MoveScaled(3,34,59,23) + MoveScaled(3,33,59,7) Spacing = True Margin = True { panLabel HBox MoveScaled(0,0,57,5) { lblBalance Label - MoveScaled(0,0,47,5) + MoveScaled(1,0,47,5) Font = Font["Bold,+5"] Foreground = &HBFBFBF& Expand = True @@ -55,10 +55,37 @@ } } { panBalance HPanel - MoveScaled(1,7,57,15) + MoveScaled(0,5,57,4) Font = Font["+2"] Expand = True Spacing = True + Indent = True + } + } + { panVideo VBox + MoveScaled(3,59,68,8) + { Panel3 Panel + MoveScaled(0,0,18,1) + Background = &H3F3F3F& + } + { VBox3 HBox + MoveScaled(1,1,66,7) + Spacing = True + Margin = True + { lblBalance2 Label + MoveScaled(0,0,24,5) + Font = Font["Bold,+5"] + Foreground = &HBFBFBF& + Expand = True + AutoResize = True + Text = ("Video device") + } + { cmbVideoDevice ComboBox + MoveScaled(35,0,24,5) + Font = Font["+2"] + Expand = True + ReadOnly = True + } } } } diff --git a/examples/examples/Multimedia/MediaPlayer/balance.png b/examples/examples/Multimedia/MediaPlayer/config.png similarity index 100% rename from examples/examples/Multimedia/MediaPlayer/balance.png rename to examples/examples/Multimedia/MediaPlayer/config.png