[DEVELOPMENT ENVIRONMENT]

* BUG: The '.lang' directory should be correctly put under version control 
  when a project become translatable.

[EXAMPLES]
* NEW: MediaPlayer: Allow to choose the video device.


git-svn-id: svn://localhost/gambas/trunk@5711 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Benoît Minisini 2013-06-29 14:22:09 +00:00
parent 0be0b8caf8
commit d6857e2926
12 changed files with 202 additions and 86 deletions

View File

@ -548,7 +548,7 @@ msgstr ""
#: FReportPaddingChooser.form:75 FSave.form:28 FSaveProjectAs.form:76 #: FReportPaddingChooser.form:75 FSave.form:28 FSaveProjectAs.form:76
#: FSearch.class:869 FSelectExtraFile.form:43 FSelectIcon.form:87 #: FSearch.class:869 FSelectExtraFile.form:43 FSelectIcon.form:87
#: FSnippet.form:57 FTableChooser.form:68 FText.form:41 FTextEditor.class:599 #: 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" msgid "Cancel"
msgstr "" msgstr ""
@ -618,21 +618,21 @@ msgstr ""
msgid "in &1:&2." msgid "in &1:&2."
msgstr "" msgstr ""
#: Design.module:355 #: Design.module:357
msgid "The program has stopped unexpectedly:" msgid "The program has stopped unexpectedly:"
msgstr "" msgstr ""
#: Design.module:355 #: Design.module:357
msgid "Please send a bug report to the following mail address: &1" msgid "Please send a bug report to the following mail address: &1"
msgstr "" msgstr ""
#: Design.module:359 #: Design.module:361
msgid "" msgid ""
"The program has returned\n" "The program has returned\n"
"the value: &1" "the value: &1"
msgstr "" 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 #: FCreateFile.form:443 FFieldChooser.form:132 FFontChooser.form:34
#: FGotoLine.form:17 FInfo.form:172 FList.form:115 FMain.class:1824 #: FGotoLine.form:17 FInfo.form:172 FList.form:115 FMain.class:1824
#: FMakeInstall.class:299 FMenu.form:372 FNewConnection.form:249 #: FMakeInstall.class:299 FMenu.form:372 FNewConnection.form:249
@ -645,11 +645,11 @@ msgstr ""
msgid "OK" msgid "OK"
msgstr "" msgstr ""
#: Design.module:841 #: Design.module:843
msgid "Output terminal" msgid "Output terminal"
msgstr "" msgstr ""
#: Design.module:868 #: Design.module:870
msgid "No terminal emulator found." msgid "No terminal emulator found."
msgstr "" msgstr ""
@ -830,7 +830,7 @@ msgstr ""
#: FConnectionEditor.form:108 FEditor.form:317 FForm.form:417 #: FConnectionEditor.form:108 FEditor.form:317 FForm.form:417
#: FHelpBrowser.form:67 FIconEditor.form:79 FImageEditor.form:62 #: FHelpBrowser.form:67 FIconEditor.form:79 FImageEditor.form:62
#: FTextEditor.form:231 FTranslate.class:648 #: FTextEditor.form:231 FTranslate.class:650
msgid "Reload" msgid "Reload"
msgstr "" msgstr ""
@ -927,7 +927,7 @@ msgid "Export..."
msgstr "" msgstr ""
#: FConnectionEditor.form:460 FForm.form:268 FMain.class:211 #: 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" msgid "Delete"
msgstr "" msgstr ""
@ -1068,7 +1068,7 @@ msgstr ""
msgid "CSV files" msgid "CSV files"
msgstr "" msgstr ""
#: FConnectionEditor.class:1421 FTranslate.class:1196 #: FConnectionEditor.class:1421 FTranslate.class:1198
msgid "All files" msgid "All files"
msgstr "" msgstr ""
@ -1408,7 +1408,7 @@ msgstr ""
msgid "Show search window" msgid "Show search window"
msgstr "" 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." msgid "Search string cannot be found."
msgstr "" msgstr ""
@ -3037,7 +3037,7 @@ msgid "There is no CHANGELOG entry for this release."
msgstr "" msgstr ""
#: FMakeInstall.class:350 FProjectVersion.class:201 FSave.form:21 #: FMakeInstall.class:350 FProjectVersion.class:201 FSave.form:21
#: Project.module:3261 #: Project.module:3259
msgid "Continue" msgid "Continue"
msgstr "" msgstr ""
@ -3143,7 +3143,7 @@ msgstr ""
msgid "*.gz;*.bz2;*.xz" msgid "*.gz;*.bz2;*.xz"
msgstr "" msgstr ""
#: FMakePatch.form:89 Project.module:4312 #: FMakePatch.form:89 Project.module:4310
msgid "Source packages" msgid "Source packages"
msgstr "" msgstr ""
@ -3219,7 +3219,7 @@ msgstr ""
msgid "This menu is too deep !" msgid "This menu is too deep !"
msgstr "" msgstr ""
#: FMenu.class:937 Project.module:5111 #: FMenu.class:937 Project.module:5109
msgid "modified" msgid "modified"
msgstr "" msgstr ""
@ -3964,7 +3964,7 @@ msgstr ""
msgid "Snapping value is incorrect." msgid "Snapping value is incorrect."
msgstr "" msgstr ""
#: FProjectProperty.class:408 Project.module:3260 #: FProjectProperty.class:408 Project.module:3258
msgid "Some components are missing: &1" msgid "Some components are missing: &1"
msgstr "" msgstr ""
@ -4560,63 +4560,63 @@ msgstr ""
msgid "Cannot read translation file for language '&1'" msgid "Cannot read translation file for language '&1'"
msgstr "" msgstr ""
#: FTranslate.class:442 #: FTranslate.class:444
msgid "Cannot save translation." msgid "Cannot save translation."
msgstr "" msgstr ""
#: FTranslate.class:552 #: FTranslate.class:554
msgid "Do you really want to delete this translation ?" msgid "Do you really want to delete this translation ?"
msgstr "" msgstr ""
#: FTranslate.class:648 #: FTranslate.class:650
msgid "Do you really want to reload this translation ?" msgid "Do you really want to reload this translation ?"
msgstr "" msgstr ""
#: FTranslate.class:662 #: FTranslate.class:664
msgid "Export a translation" msgid "Export a translation"
msgstr "" msgstr ""
#: FTranslate.class:847 #: FTranslate.class:849
msgid "Please select the translation file to import." msgid "Please select the translation file to import."
msgstr "" msgstr ""
#: FTranslate.class:885 #: FTranslate.class:887
msgid "No translation were picked up." msgid "No translation were picked up."
msgstr "" msgstr ""
#: FTranslate.class:887 #: FTranslate.class:889
msgid "One translation was picked up." msgid "One translation was picked up."
msgstr "" msgstr ""
#: FTranslate.class:889 #: FTranslate.class:891
msgid "&1 translations were picked up." msgid "&1 translations were picked up."
msgstr "" msgstr ""
#: FTranslate.class:897 #: FTranslate.class:899
msgid "Cannot import translation file." msgid "Cannot import translation file."
msgstr "" msgstr ""
#: FTranslate.class:946 #: FTranslate.class:948
msgid "Translated string symbols do not match untranslated string ones." msgid "Translated string symbols do not match untranslated string ones."
msgstr "" msgstr ""
#: FTranslate.class:959 #: FTranslate.class:961
msgid "Everything seems to be correct." msgid "Everything seems to be correct."
msgstr "" msgstr ""
#: FTranslate.class:982 #: FTranslate.class:984
msgid "&1 strings. Everything is translated!" msgid "&1 strings. Everything is translated!"
msgstr "" msgstr ""
#: FTranslate.class:984 #: FTranslate.class:986
msgid "&1 strings. One is not translated. &3% done." msgid "&1 strings. One is not translated. &3% done."
msgstr "" msgstr ""
#: FTranslate.class:986 #: FTranslate.class:988
msgid "&1 strings. &2 are not translated. &3% done." msgid "&1 strings. &2 are not translated. &3% done."
msgstr "" msgstr ""
#: FTranslate.class:1111 Project.module:4277 #: FTranslate.class:1113 Project.module:4275
msgid "The '&1' command has failed." msgid "The '&1' command has failed."
msgstr "" msgstr ""
@ -6241,150 +6241,150 @@ msgstr ""
msgid "in &1." msgid "in &1."
msgstr "" msgstr ""
#: Project.module:2331 #: Project.module:2329
msgid "" msgid ""
"Some project source files are in conflict.\n" "Some project source files are in conflict.\n"
"Please solve them if you want to compile the project." "Please solve them if you want to compile the project."
msgstr "" msgstr ""
#: Project.module:2335 #: Project.module:2333
msgid "Compiling project" msgid "Compiling project"
msgstr "" msgstr ""
#: Project.module:2576 #: Project.module:2574
msgid "File already exists." msgid "File already exists."
msgstr "" msgstr ""
#: Project.module:2608 #: Project.module:2606
msgid "Directory already exists." msgid "Directory already exists."
msgstr "" msgstr ""
#: Project.module:2620 #: Project.module:2618
msgid "Cannot link template file." msgid "Cannot link template file."
msgstr "" msgstr ""
#: Project.module:2626 #: Project.module:2624
msgid "Cannot copy template file." msgid "Cannot copy template file."
msgstr "" msgstr ""
#: Project.module:2836 #: Project.module:2834
msgid "Making executable..." msgid "Making executable..."
msgstr "" msgstr ""
#: Project.module:2880 #: Project.module:2878
msgid "Cannot make executable." msgid "Cannot make executable."
msgstr "" msgstr ""
#: Project.module:3450 #: Project.module:3448
msgid "Cannot write project file." msgid "Cannot write project file."
msgstr "" msgstr ""
#: Project.module:3492 #: Project.module:3490
msgid "Unable to create desktop shortcut." msgid "Unable to create desktop shortcut."
msgstr "" msgstr ""
#: Project.module:3738 #: Project.module:3736
msgid "The directory will be removed at the next commit." msgid "The directory will be removed at the next commit."
msgstr "" msgstr ""
#: Project.module:3755 #: Project.module:3753
msgid "You must define a startup class or form!" msgid "You must define a startup class or form!"
msgstr "" msgstr ""
#: Project.module:3786 #: Project.module:3784
msgid "Please type a name." msgid "Please type a name."
msgstr "" msgstr ""
#: Project.module:3790 #: Project.module:3788
msgid "This name contains a forbidden character:" msgid "This name contains a forbidden character:"
msgstr "" msgstr ""
#: Project.module:3794 #: Project.module:3792
msgid "The name cannot begins with a dot." msgid "The name cannot begins with a dot."
msgstr "" msgstr ""
#: Project.module:3798 #: Project.module:3796
msgid "This name is already used. Choose another one." msgid "This name is already used. Choose another one."
msgstr "" msgstr ""
#: Project.module:3834 #: Project.module:3832
msgid "" msgid ""
"A class name must begin with a letter or an underscore, followed by any " "A class name must begin with a letter or an underscore, followed by any "
"letter or digit." "letter or digit."
msgstr "" msgstr ""
#: Project.module:3882 #: Project.module:3880
msgid "Destination already exists." msgid "Destination already exists."
msgstr "" msgstr ""
#: Project.module:4094 #: Project.module:4092
msgid "Unable to rename '&1'" msgid "Unable to rename '&1'"
msgstr "" msgstr ""
#: Project.module:4210 #: Project.module:4208
msgid "Please type a project name." msgid "Please type a project name."
msgstr "" msgstr ""
#: Project.module:4218 #: Project.module:4216
msgid "The project name cannot begin with a dot." msgid "The project name cannot begin with a dot."
msgstr "" msgstr ""
#: Project.module:4221 #: Project.module:4219
msgid "Non-ASCII characters are forbidden in a project name." msgid "Non-ASCII characters are forbidden in a project name."
msgstr "" msgstr ""
#: Project.module:4222 #: Project.module:4220
msgid "" msgid ""
"The following characters are forbidden in a project name: ? * / \\ SPACE" "The following characters are forbidden in a project name: ? * / \\ SPACE"
msgstr "" msgstr ""
#: Project.module:4229 #: Project.module:4227
msgid "This project already exists." msgid "This project already exists."
msgstr "" msgstr ""
#: Project.module:4232 #: Project.module:4230
msgid "The project directory already exists." msgid "The project directory already exists."
msgstr "" msgstr ""
#: Project.module:4234 #: Project.module:4232
msgid "" msgid ""
"The project directory cannot be created because a file with the same name " "The project directory cannot be created because a file with the same name "
"already exists." "already exists."
msgstr "" msgstr ""
#: Project.module:4288 #: Project.module:4286
msgid "Unable to create source archive." msgid "Unable to create source archive."
msgstr "" msgstr ""
#: Project.module:4311 #: Project.module:4309
msgid "Create source package" msgid "Create source package"
msgstr "" msgstr ""
#: Project.module:4603 #: Project.module:4601
msgid "Cannot copy file &1." msgid "Cannot copy file &1."
msgstr "" msgstr ""
#: Project.module:4651 #: Project.module:4649
msgid "Cannot create link &1." msgid "Cannot create link &1."
msgstr "" msgstr ""
#: Project.module:4666 #: Project.module:4664
msgid "Cannot move a directory inside itself." msgid "Cannot move a directory inside itself."
msgstr "" msgstr ""
#: Project.module:4734 #: Project.module:4732
msgid "Cannot move file &1." msgid "Cannot move file &1."
msgstr "" msgstr ""
#: Project.module:5264 #: Project.module:5262
msgid "Project cleanup..." msgid "Project cleanup..."
msgstr "" msgstr ""
#: Project.module:5270 #: Project.module:5268
msgid "Project files conversion..." msgid "Project files conversion..."
msgstr "" msgstr ""
#: Project.module:5300 #: Project.module:5298
msgid "Unable to convert &1" msgid "Unable to convert &1"
msgstr "" msgstr ""

View File

@ -348,6 +348,8 @@ Public Sub Process_Kill()
'PRINT "KILL" 'PRINT "KILL"
If Not Project.AboutToQuit Then AfterStop 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 If $hProcess.State = Process.Crashed Then
' SIGKILL and SIGTERM are not considered as bugs in the program ' SIGKILL and SIGTERM are not considered as bugs in the program

View File

@ -2287,14 +2287,12 @@ Public Function GetCompileCommand(bAll As Boolean, bNoDebug As Boolean, bMakeExe
End End
Private Sub CreateLangDirectory() Public Sub CreateLangDirectory()
Dim sDir As String = Project.Dir &/ ".lang" Dim sDir As String = Project.Dir &/ ".lang"
If Not Exist(sDir) Then Try Mkdir sDir
Mkdir sDir If IsDir(sDir) And If Dir(sDir).Count = 0 Then VersionControl.AddDir(sDir)
VersionControl.AddDir(sDir)
Endif
End End

View File

@ -388,6 +388,8 @@ Private Sub SaveTranslate(Optional bForce As Boolean)
UpdateOrg() UpdateOrg()
Project.CreateLangDirectory()
sPathMO = Left$($sPath, -3) & ".mo" sPathMO = Left$($sPath, -3) & ".mo"
bExistMO = Exist(sPathMO) bExistMO = Exist(sPathMO)

Binary file not shown.

View File

@ -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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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"

View File

@ -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." 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" Environment="GB_GUI=gb.qt4"
TabSize=2 TabSize=2
Translate=1
Language=en
Packager=1 Packager=1

View File

@ -21,7 +21,7 @@ Public Sub _new()
panToolbar.H = 48 + Desktop.Scale * 2 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 = New DrawingArea(panToolbar) As "sldTime"
sldTime.Resize(8, 8) sldTime.Resize(8, 8)

View File

@ -133,6 +133,7 @@ Private Sub Action(sAction As String)
Dim iState As Integer Dim iState As Integer
Dim sName As String Dim sName As String
Dim iName As Integer Dim iName As Integer
Dim sVideo As String
Select sAction Select sAction
@ -154,14 +155,17 @@ Private Sub Action(sAction As String)
Case "video" Case "video"
FControl.SetTitle("v4l2:///dev/video0") sVideo = FTags.GetVideoDevice()
Action("stop") If sVideo Then
$hPlayer.Subtitles.Enabled = False FControl.SetTitle(("Video device") & " " & sVideo)
$hPlayer.URL = "v4l2:///dev/video0" Action("stop")
FTags.Clear($hPlayer) $hPlayer.Subtitles.Enabled = False
Action("play") $hPlayer.URL = "v4l2://" & sVideo
FTags.Clear($hPlayer)
Action("play")
Endif
Case "info" Case "info", "config"
If $bShowTags Then If $bShowTags Then
CAnimation.Start(FTags, "Opacity", 0, 250, Me) CAnimation.Start(FTags, "Opacity", 0, 250, Me)
'CAnimation.Start(Me, "TagsX", - FTags.W, 250) 'CAnimation.Start(Me, "TagsX", - FTags.W, 250)

View File

@ -39,8 +39,6 @@ Public Sub Clear(hPlayer As MediaPlayer)
With hPlayer.Balance[I] With hPlayer.Balance[I]
Print .Name; ": "; .Min;; .Max;; .Value
hLabel = New Label(panBalance) hLabel = New Label(panBalance)
hLabel.Text = GetBalanceName(.Name) hLabel.Text = GetBalanceName(.Name)
hLabel.Foreground = lblBalance.Foreground hLabel.Foreground = lblBalance.Foreground
@ -94,12 +92,24 @@ End
Public Sub _new() Public Sub _new()
Dim sFile As String
gvwTags.Columns.Count = 2 gvwTags.Columns.Count = 2
btnResetBalance = New CButton(panLabel) As "btnResetBalance" btnResetBalance = New CButton(panLabel) As "btnResetBalance"
btnResetBalance.Resize(panLabel.H, panLabel.H) btnResetBalance.Resize(panLabel.H, panLabel.H)
btnResetBalance.Image = Image.Load("undo.png") 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 End
Public Sub Form_Resize() Public Sub Form_Resize()
@ -128,3 +138,10 @@ Public Sub btnResetBalance_Click()
Next Next
End End
Public Sub GetVideoDevice() As String
If cmbVideoDevice.Enabled Then Return cmbVideoDevice.Text
End

View File

@ -1,7 +1,7 @@
# Gambas Form File 3.0 # Gambas Form File 3.0
{ Form Form { Form Form
MoveScaled(0,0,82,63) MoveScaled(0,0,82,82)
Background = &H3F3F3F& Background = &H3F3F3F&
Resizable = False Resizable = False
Border = False Border = False
@ -11,7 +11,7 @@
Spacing = True Spacing = True
Margin = True Margin = True
{ panTags Panel { panTags Panel
MoveScaled(2,3,64,58) MoveScaled(2,3,75,78)
Background = &H000000& Background = &H000000&
Arrangement = Arrange.Vertical Arrangement = Arrange.Vertical
{ Panel2 VBox { Panel2 VBox
@ -37,17 +37,17 @@
} }
} }
{ Panel1 Panel { Panel1 Panel
MoveScaled(4,31,18,1) MoveScaled(2,31,18,1)
Background = &H3F3F3F& Background = &H3F3F3F&
} }
{ VBox1 VBox { VBox1 VBox
MoveScaled(3,34,59,23) MoveScaled(3,33,59,7)
Spacing = True Spacing = True
Margin = True Margin = True
{ panLabel HBox { panLabel HBox
MoveScaled(0,0,57,5) MoveScaled(0,0,57,5)
{ lblBalance Label { lblBalance Label
MoveScaled(0,0,47,5) MoveScaled(1,0,47,5)
Font = Font["Bold,+5"] Font = Font["Bold,+5"]
Foreground = &HBFBFBF& Foreground = &HBFBFBF&
Expand = True Expand = True
@ -55,10 +55,37 @@
} }
} }
{ panBalance HPanel { panBalance HPanel
MoveScaled(1,7,57,15) MoveScaled(0,5,57,4)
Font = Font["+2"] Font = Font["+2"]
Expand = True Expand = True
Spacing = 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
}
} }
} }
} }

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB