Skip to content

Commit

Permalink
Add option to convert all audio tracks
Browse files Browse the repository at this point in the history
  • Loading branch information
chamfay committed May 25, 2018
1 parent 38a3d64 commit cdd2216
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 3 additions & 1 deletion curlew.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ Comment[ar]=محول وسائط على لينكس سهل الاستخدام
Comment[fr]=Un Convertisseur Multimédia simple à utiliser sous Linux
Encoding=UTF-8
Exec=curlew %U
GenericName[en_US]=Curlew
GenericName=Curlew
Icon=curlew
Name[en]=Curlew
MimeType=
Name[en_US]=Curlew
Name=Curlew
Name[ar]=كروان
Expand Down
11 changes: 10 additions & 1 deletion modules/curlew.py
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,11 @@ def __init__(self, app, *files_list):
grid_audio.append_row(_("Audio Channels"), self.c_ach)
grid_audio.append_row(_("Audio Codec"), hbox_acodec)

# Convert all tracks
self.cb_all_tracks = Gtk.CheckButton(_('Include all tracks'))
self.cb_all_tracks.set_tooltip_text(_('Convert all audio tracks of file'))
self.vb_audio.add(self.cb_all_tracks)

# Volume slider
self.hb_volume = LabeledHBox(_('Volume (%)'), self.vb_audio)
self.vol_scale = HScale(self.hb_volume, 100, 25, 400, 25)
Expand Down Expand Up @@ -1570,6 +1575,10 @@ def build_cmd(self,
cmd.extend(['-acodec', 'copy'])
cmd.extend(['-vcodec', 'copy'])

# Convert all audio tracks
if self.cb_all_tracks.get_active():
cmd.extend(['-map', '0:v', '-map', '0:a'])

#--- Extra options (add other specific options if exist)
if self.e_extra.get_text().strip() != '':
cmd.extend(self.e_extra.get_text().split())
Expand Down Expand Up @@ -1599,7 +1608,7 @@ def build_cmd(self,

#--- Last
cmd.append(out_file)
#print(' '.join(cmd))
print(' '.join(cmd))
return cmd

#--- Convert funtcion
Expand Down

0 comments on commit cdd2216

Please sign in to comment.