Merge lp:~michael-sheldon/jokosher/windows_port into lp:jokosher
- windows_port
- Merge into main
Proposed by
Michael Sheldon
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | not available | ||||
Proposed branch: | lp:~michael-sheldon/jokosher/windows_port | ||||
Merge into: | lp:jokosher | ||||
Diff against target: | None lines | ||||
To merge this branch: | bzr merge lp:~michael-sheldon/jokosher/windows_port | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jokosher Code | Pending | ||
Review via email: mp+4935@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'Jokosher/ControlsBox.py' | |||
2 | --- Jokosher/ControlsBox.py 2007-07-10 22:25:55 +0000 | |||
3 | +++ Jokosher/ControlsBox.py 2009-02-25 12:39:22 +0000 | |||
4 | @@ -54,16 +54,16 @@ | |||
5 | 54 | self.muteImgEnabled = Utils.GetIconThatMayBeMissing("stock_volume-mute", gtk.ICON_SIZE_BUTTON, False) | 54 | self.muteImgEnabled = Utils.GetIconThatMayBeMissing("stock_volume-mute", gtk.ICON_SIZE_BUTTON, False) |
6 | 55 | 55 | ||
7 | 56 | self.recTip = gtk.Tooltips() | 56 | self.recTip = gtk.Tooltips() |
9 | 57 | self.recButton = gtk.ToggleButton("") | 57 | self.recButton = gtk.ToggleButton() |
10 | 58 | self.recTip.set_tip(self.recButton, self.recTipEnabled, None) | 58 | self.recTip.set_tip(self.recButton, self.recTipEnabled, None) |
11 | 59 | self.recButton.connect("toggled", self.OnArm) | 59 | self.recButton.connect("toggled", self.OnArm) |
12 | 60 | 60 | ||
14 | 61 | self.muteButton = gtk.ToggleButton("") | 61 | self.muteButton = gtk.ToggleButton() |
15 | 62 | self.muteButton.connect("toggled", self.OnMute) | 62 | self.muteButton.connect("toggled", self.OnMute) |
16 | 63 | self.muteTip = gtk.Tooltips() | 63 | self.muteTip = gtk.Tooltips() |
17 | 64 | self.muteTip.set_tip(self.muteButton, self.muteTipDisabled, None) | 64 | self.muteTip.set_tip(self.muteButton, self.muteTipDisabled, None) |
18 | 65 | 65 | ||
20 | 66 | self.soloButton = gtk.ToggleButton("") | 66 | self.soloButton = gtk.ToggleButton() |
21 | 67 | self.soloTip = gtk.Tooltips() | 67 | self.soloTip = gtk.Tooltips() |
22 | 68 | self.soloTip.set_tip(self.soloButton, self.soloTipDisabled, None) | 68 | self.soloTip.set_tip(self.soloButton, self.soloTipDisabled, None) |
23 | 69 | self.soloButton.connect("toggled", self.OnSolo) | 69 | self.soloButton.connect("toggled", self.OnSolo) |
24 | 70 | 70 | ||
25 | === modified file 'Jokosher/Event.py' | |||
26 | --- Jokosher/Event.py 2009-02-18 03:05:16 +0000 | |||
27 | +++ Jokosher/Event.py 2009-03-19 23:28:10 +0000 | |||
28 | @@ -22,6 +22,7 @@ | |||
29 | 22 | import Globals | 22 | import Globals |
30 | 23 | import gettext | 23 | import gettext |
31 | 24 | import urllib | 24 | import urllib |
32 | 25 | import PlatformUtils | ||
33 | 25 | 26 | ||
34 | 26 | from elements.singledecodebin import SingleDecodeBin | 27 | from elements.singledecodebin import SingleDecodeBin |
35 | 27 | _ = gettext.gettext | 28 | _ = gettext.gettext |
36 | @@ -51,7 +52,7 @@ | |||
37 | 51 | } | 52 | } |
38 | 52 | 53 | ||
39 | 53 | """ The level sample interval in seconds """ | 54 | """ The level sample interval in seconds """ |
41 | 54 | LEVEL_INTERVAL = 0.01 | 55 | LEVEL_INTERVAL = 0.1 |
42 | 55 | LEVELS_FILE_EXTENSION = ".leveldata" | 56 | LEVELS_FILE_EXTENSION = ".leveldata" |
43 | 56 | NANO_TO_MILLI_DIVISOR = gst.SECOND / 1000 | 57 | NANO_TO_MILLI_DIVISOR = gst.SECOND / 1000 |
44 | 57 | 58 | ||
45 | @@ -161,9 +162,9 @@ | |||
46 | 161 | 162 | ||
47 | 162 | Globals.debug("creating SingleDecodeBin") | 163 | Globals.debug("creating SingleDecodeBin") |
48 | 163 | caps = gst.caps_from_string("audio/x-raw-int;audio/x-raw-float") | 164 | caps = gst.caps_from_string("audio/x-raw-int;audio/x-raw-float") |
50 | 164 | f = "file://" + self.file | 165 | f = PlatformUtils.pathname2url(self.file) |
51 | 166 | Globals.debug("file uri is:", f) | ||
52 | 165 | self.single_decode_bin = SingleDecodeBin(caps=caps, uri=f) | 167 | self.single_decode_bin = SingleDecodeBin(caps=caps, uri=f) |
53 | 166 | Globals.debug("file uri is:", f) | ||
54 | 167 | self.gnlsrc.add(self.single_decode_bin) | 168 | self.gnlsrc.add(self.single_decode_bin) |
55 | 168 | Globals.debug("setting event properties:") | 169 | Globals.debug("setting event properties:") |
56 | 169 | propsDict = { | 170 | propsDict = { |
57 | @@ -212,7 +213,7 @@ | |||
58 | 212 | self.instrument.project.deleteOnCloseAudioFiles.remove(self.file) | 213 | self.instrument.project.deleteOnCloseAudioFiles.remove(self.file) |
59 | 213 | 214 | ||
60 | 214 | self.temp = self.file | 215 | self.temp = self.file |
62 | 215 | if os.path.samefile(self.instrument.project.audio_path, os.path.dirname(self.file)): | 216 | if PlatformUtils.samefile(self.instrument.project.audio_path, os.path.dirname(self.file)): |
63 | 216 | # If the file is in the audio dir, just include the filename, not the absolute path | 217 | # If the file is in the audio dir, just include the filename, not the absolute path |
64 | 217 | self.file = os.path.basename(self.file) | 218 | self.file = os.path.basename(self.file) |
65 | 218 | 219 | ||
66 | @@ -772,10 +773,14 @@ | |||
67 | 772 | """ | 773 | """ |
68 | 773 | Renders the level information for the GUI. | 774 | Renders the level information for the GUI. |
69 | 774 | """ | 775 | """ |
73 | 775 | pipe = """filesrc name=src location=%s ! decodebin ! audioconvert ! level interval=%d message=true ! fakesink""" | 776 | pipe = """filesrc name=src ! decodebin ! audioconvert ! level message=true name=level_element ! fakesink""" |
71 | 776 | |||
72 | 777 | pipe = pipe % (self.file.replace(" ", "\ "), self.LEVEL_INTERVAL * gst.SECOND) | ||
74 | 778 | self.loadingPipeline = gst.parse_launch(pipe) | 777 | self.loadingPipeline = gst.parse_launch(pipe) |
75 | 778 | |||
76 | 779 | filesrc = self.loadingPipeline.get_by_name("src") | ||
77 | 780 | level = self.loadingPipeline.get_by_name("level_element") | ||
78 | 781 | |||
79 | 782 | filesrc.set_property("location", self.file) | ||
80 | 783 | level.set_property("interval", int(self.LEVEL_INTERVAL * gst.SECOND)) | ||
81 | 779 | 784 | ||
82 | 780 | self.bus = self.loadingPipeline.get_bus() | 785 | self.bus = self.loadingPipeline.get_bus() |
83 | 781 | self.bus.add_signal_watch() | 786 | self.bus.add_signal_watch() |
84 | @@ -798,14 +803,25 @@ | |||
85 | 798 | Copies the audio file to the new file location and reads the levels | 803 | Copies the audio file to the new file location and reads the levels |
86 | 799 | at the same time. | 804 | at the same time. |
87 | 800 | """ | 805 | """ |
89 | 801 | if not gst.element_make_from_uri(gst.URI_SRC, uri): | 806 | |
90 | 807 | urisrc = gst.element_make_from_uri(gst.URI_SRC, uri) | ||
91 | 808 | if not urisrc: | ||
92 | 802 | #This means that here is no gstreamer src element on the system that can handle this URI type. | 809 | #This means that here is no gstreamer src element on the system that can handle this URI type. |
93 | 803 | return False | 810 | return False |
94 | 804 | 811 | ||
98 | 805 | pipe = """%s ! tee name=mytee mytee. ! queue ! filesink location=%s """ +\ | 812 | pipe = """tee name=mytee mytee. ! queue ! filesink name=sink """ +\ |
99 | 806 | """mytee. ! queue ! decodebin ! audioconvert ! level interval=%d message=true ! fakesink""" | 813 | """mytee. ! queue ! decodebin ! audioconvert ! level name=level_element message=true ! fakesink""" |
97 | 807 | pipe = pipe % (urllib.quote(uri,":/"), self.file.replace(" ", "\ "), self.LEVEL_INTERVAL * gst.SECOND) | ||
100 | 808 | self.loadingPipeline = gst.parse_launch(pipe) | 814 | self.loadingPipeline = gst.parse_launch(pipe) |
101 | 815 | |||
102 | 816 | tee = self.loadingPipeline.get_by_name("mytee") | ||
103 | 817 | filesink = self.loadingPipeline.get_by_name("sink") | ||
104 | 818 | level = self.loadingPipeline.get_by_name("level_element") | ||
105 | 819 | |||
106 | 820 | self.loadingPipeline.add(urisrc) | ||
107 | 821 | urisrc.link(tee) | ||
108 | 822 | |||
109 | 823 | filesink.set_property("location", self.file) | ||
110 | 824 | level.set_property("interval", int(self.LEVEL_INTERVAL * gst.SECOND)) | ||
111 | 809 | 825 | ||
112 | 810 | self.bus = self.loadingPipeline.get_bus() | 826 | self.bus = self.loadingPipeline.get_bus() |
113 | 811 | self.bus.add_signal_watch() | 827 | self.bus.add_signal_watch() |
114 | 812 | 828 | ||
115 | === modified file 'Jokosher/EventLaneViewer.py' | |||
116 | --- Jokosher/EventLaneViewer.py 2009-02-15 23:11:00 +0000 | |||
117 | +++ Jokosher/EventLaneViewer.py 2009-03-19 23:28:10 +0000 | |||
118 | @@ -15,6 +15,7 @@ | |||
119 | 15 | from EventViewer import * | 15 | from EventViewer import * |
120 | 16 | import os.path | 16 | import os.path |
121 | 17 | import gettext | 17 | import gettext |
122 | 18 | import PlatformUtils | ||
123 | 18 | import urllib # To decode URI's | 19 | import urllib # To decode URI's |
124 | 19 | import Globals # To get projectfolder | 20 | import Globals # To get projectfolder |
125 | 20 | import ui.EventLaneHSeparator as EventLaneHSeparator | 21 | import ui.EventLaneHSeparator as EventLaneHSeparator |
126 | @@ -300,8 +301,9 @@ | |||
127 | 300 | if event: | 301 | if event: |
128 | 301 | #if we we're called from a mouse click, use the mouse position as the start | 302 | #if we we're called from a mouse click, use the mouse position as the start |
129 | 302 | start = (self.mouseDownPos[0]/self.project.viewScale) + self.project.viewStart | 303 | start = (self.mouseDownPos[0]/self.project.viewScale) + self.project.viewStart |
132 | 303 | 304 | ||
133 | 304 | self.instrument.AddEventsFromList(start, filenames) | 305 | uris = [PlatformUtils.pathname2url(filename) for filename in filenames] |
134 | 306 | self.instrument.AddEventsFromList(start, uris) | ||
135 | 305 | 307 | ||
136 | 306 | #_____________________________________________________________________ | 308 | #_____________________________________________________________________ |
137 | 307 | 309 | ||
138 | 308 | 310 | ||
139 | === modified file 'Jokosher/Globals.py' | |||
140 | --- Jokosher/Globals.py 2009-02-23 00:47:21 +0000 | |||
141 | +++ Jokosher/Globals.py 2009-03-19 23:39:14 +0000 | |||
142 | @@ -18,6 +18,7 @@ | |||
143 | 18 | import gobject, gtk | 18 | import gobject, gtk |
144 | 19 | import xdg.BaseDirectory | 19 | import xdg.BaseDirectory |
145 | 20 | import shutil | 20 | import shutil |
146 | 21 | import PlatformUtils | ||
147 | 21 | 22 | ||
148 | 22 | import gettext | 23 | import gettext |
149 | 23 | _ = gettext.gettext | 24 | _ = gettext.gettext |
150 | @@ -37,7 +38,7 @@ | |||
151 | 37 | "windowheight" : 550, | 38 | "windowheight" : 550, |
152 | 38 | "windowwidth" : 900, | 39 | "windowwidth" : 900, |
153 | 39 | } | 40 | } |
155 | 40 | 41 | ||
156 | 41 | recording = { | 42 | recording = { |
157 | 42 | "fileformat": "flacenc", | 43 | "fileformat": "flacenc", |
158 | 43 | "file_extension": "flac", | 44 | "file_extension": "flac", |
159 | @@ -45,13 +46,17 @@ | |||
160 | 45 | "audiosrc" : "gconfaudiosrc", | 46 | "audiosrc" : "gconfaudiosrc", |
161 | 46 | "device" : "default" | 47 | "device" : "default" |
162 | 47 | } | 48 | } |
163 | 49 | # Overwrite with platform specific settings | ||
164 | 50 | recording.update( PlatformUtils.GetRecordingDefaults() ) | ||
165 | 48 | 51 | ||
166 | 49 | playback = { | 52 | playback = { |
167 | 50 | "devicename": "default", | 53 | "devicename": "default", |
168 | 51 | "device": "default", | 54 | "device": "default", |
169 | 52 | "audiosink":"autoaudiosink" | 55 | "audiosink":"autoaudiosink" |
170 | 53 | } | 56 | } |
172 | 54 | 57 | # Overwrite with platform specific settings | |
173 | 58 | playback.update( PlatformUtils.GetPlaybackDefaults() ) | ||
174 | 59 | |||
175 | 55 | extensions = { | 60 | extensions = { |
176 | 56 | "extensions_blacklist": "" | 61 | "extensions_blacklist": "" |
177 | 57 | } | 62 | } |
178 | @@ -699,6 +704,7 @@ | |||
179 | 699 | 704 | ||
180 | 700 | SAMPLE_RATES = [8000, 11025, 22050, 32000, 44100, 48000, 96000, 192000] | 705 | SAMPLE_RATES = [8000, 11025, 22050, 32000, 44100, 48000, 96000, 192000] |
181 | 701 | 706 | ||
182 | 707 | |||
183 | 702 | PLAYBACK_BACKENDS = [ | 708 | PLAYBACK_BACKENDS = [ |
184 | 703 | (_("Autodetect"), "autoaudiosink"), | 709 | (_("Autodetect"), "autoaudiosink"), |
185 | 704 | (_("Use GNOME Settings"), "gconfaudiosink"), | 710 | (_("Use GNOME Settings"), "gconfaudiosink"), |
186 | @@ -706,6 +712,8 @@ | |||
187 | 706 | ("OSS", "osssink"), | 712 | ("OSS", "osssink"), |
188 | 707 | ("JACK", "jackaudiosink"), | 713 | ("JACK", "jackaudiosink"), |
189 | 708 | ("PulseAudio", "pulsesink"), | 714 | ("PulseAudio", "pulsesink"), |
190 | 715 | ("Direct Sound", "directsoundsink"), | ||
191 | 716 | ("Core Audio", "osxaudiosink") | ||
192 | 709 | ] | 717 | ] |
193 | 710 | 718 | ||
194 | 711 | CAPTURE_BACKENDS = [ | 719 | CAPTURE_BACKENDS = [ |
195 | @@ -714,6 +722,8 @@ | |||
196 | 714 | ("OSS", "osssrc"), | 722 | ("OSS", "osssrc"), |
197 | 715 | ("JACK", "jackaudiosrc"), | 723 | ("JACK", "jackaudiosrc"), |
198 | 716 | ("PulseAudio", "pulsesrc"), | 724 | ("PulseAudio", "pulsesrc"), |
199 | 725 | ("Direct Sound", "dshowaudiosrc"), | ||
200 | 726 | ("Core Audio", "osxaudiosrc") | ||
201 | 717 | ] | 727 | ] |
202 | 718 | 728 | ||
203 | 719 | """ Default Instruments """ | 729 | """ Default Instruments """ |
204 | 720 | 730 | ||
205 | === modified file 'Jokosher/Instrument.py' | |||
206 | --- Jokosher/Instrument.py 2009-02-18 03:05:16 +0000 | |||
207 | +++ Jokosher/Instrument.py 2009-03-19 23:28:10 +0000 | |||
208 | @@ -15,6 +15,7 @@ | |||
209 | 15 | import pygst | 15 | import pygst |
210 | 16 | pygst.require("0.10") | 16 | pygst.require("0.10") |
211 | 17 | import gst | 17 | import gst |
212 | 18 | import PlatformUtils | ||
213 | 18 | import os, time, shutil | 19 | import os, time, shutil |
214 | 19 | import urlparse # To split up URI's | 20 | import urlparse # To split up URI's |
215 | 20 | import gobject | 21 | import gobject |
216 | @@ -199,7 +200,7 @@ | |||
217 | 199 | self.volumeElement.link(self.levelElement) | 200 | self.volumeElement.link(self.levelElement) |
218 | 200 | self.levelElement.link(self.panElement) | 201 | self.levelElement.link(self.panElement) |
219 | 201 | self.panElement.link(self.resample) | 202 | self.panElement.link(self.resample) |
221 | 202 | 203 | ||
222 | 203 | self.playghostpad = gst.GhostPad("src", self.resample.get_pad("src")) | 204 | self.playghostpad = gst.GhostPad("src", self.resample.get_pad("src")) |
223 | 204 | self.playbackbin.add_pad(self.playghostpad) | 205 | self.playbackbin.add_pad(self.playghostpad) |
224 | 205 | 206 | ||
225 | @@ -541,7 +542,7 @@ | |||
226 | 541 | 542 | ||
227 | 542 | Parameters: | 543 | Parameters: |
228 | 543 | start -- the offset time in seconds for the first event. | 544 | start -- the offset time in seconds for the first event. |
230 | 544 | fileList -- paths or URIs to the Event files. | 545 | fileList -- URIs to the Event files. |
231 | 545 | copyfile -- True = copy the files to Project's audio directory. | 546 | copyfile -- True = copy the files to Project's audio directory. |
232 | 546 | False = don't copy the files to the Project's audio directory. | 547 | False = don't copy the files to the Project's audio directory. |
233 | 547 | """ | 548 | """ |
234 | @@ -555,6 +556,7 @@ | |||
235 | 555 | # Parse the uri, and continue only if it is pointing to a local file | 556 | # Parse the uri, and continue only if it is pointing to a local file |
236 | 556 | (scheme, domain, file, params, query, fragment) = urlparse.urlparse(uri, "file", False) | 557 | (scheme, domain, file, params, query, fragment) = urlparse.urlparse(uri, "file", False) |
237 | 557 | if scheme == "file": | 558 | if scheme == "file": |
238 | 559 | file = PlatformUtils.url2pathname(file) | ||
239 | 558 | event = self.addEventFromFile(start, file, copyFile, _undoAction_=undoAction) | 560 | event = self.addEventFromFile(start, file, copyFile, _undoAction_=undoAction) |
240 | 559 | else: | 561 | else: |
241 | 560 | event = self.addEventFromURL(start, uri, _undoAction_=undoAction) | 562 | event = self.addEventFromURL(start, uri, _undoAction_=undoAction) |
242 | 561 | 563 | ||
243 | === modified file 'Jokosher/JokosherApp.py' | |||
244 | --- Jokosher/JokosherApp.py 2009-02-19 01:48:34 +0000 | |||
245 | +++ Jokosher/JokosherApp.py 2009-03-19 23:28:10 +0000 | |||
246 | @@ -27,6 +27,7 @@ | |||
247 | 27 | import InstrumentConnectionsDialog, StatusBar | 27 | import InstrumentConnectionsDialog, StatusBar |
248 | 28 | import EffectPresets, Extension, ExtensionManager | 28 | import EffectPresets, Extension, ExtensionManager |
249 | 29 | import Utils, AudioPreview, MixdownProfileDialog, MixdownActions | 29 | import Utils, AudioPreview, MixdownProfileDialog, MixdownActions |
250 | 30 | import PlatformUtils | ||
251 | 30 | 31 | ||
252 | 31 | #========================================================================= | 32 | #========================================================================= |
253 | 32 | 33 | ||
254 | @@ -1462,7 +1463,8 @@ | |||
255 | 1462 | displayed to user detailing the error. | 1463 | displayed to user detailing the error. |
256 | 1463 | """ | 1464 | """ |
257 | 1464 | try: | 1465 | try: |
259 | 1465 | self.SetProject(ProjectManager.LoadProjectFile(path)) | 1466 | uri = PlatformUtils.pathname2url(path) |
260 | 1467 | self.SetProject(ProjectManager.LoadProjectFile(uri)) | ||
261 | 1466 | return True | 1468 | return True |
262 | 1467 | except ProjectManager.OpenProjectError, e: | 1469 | except ProjectManager.OpenProjectError, e: |
263 | 1468 | self.ShowOpenProjectErrorDialog(e,parent) | 1470 | self.ShowOpenProjectErrorDialog(e,parent) |
264 | 1469 | 1471 | ||
265 | === modified file 'Jokosher/NewProjectDialog.py' | |||
266 | --- Jokosher/NewProjectDialog.py 2008-12-18 19:07:15 +0000 | |||
267 | +++ Jokosher/NewProjectDialog.py 2009-03-19 23:28:10 +0000 | |||
268 | @@ -12,7 +12,7 @@ | |||
269 | 12 | import gtk.glade | 12 | import gtk.glade |
270 | 13 | import os | 13 | import os |
271 | 14 | import ProjectManager | 14 | import ProjectManager |
273 | 15 | import pwd | 15 | import PlatformUtils |
274 | 16 | import Globals | 16 | import Globals |
275 | 17 | import gettext | 17 | import gettext |
276 | 18 | _ = gettext.gettext | 18 | _ = gettext.gettext |
277 | @@ -75,17 +75,9 @@ | |||
278 | 75 | self.templatecombo.add_attribute(text, "text", 0) | 75 | self.templatecombo.add_attribute(text, "text", 0) |
279 | 76 | 76 | ||
280 | 77 | self.templatecombo.set_active(0) | 77 | self.templatecombo.set_active(0) |
282 | 78 | 78 | ||
283 | 79 | # Default author to name of currently logged in user | 79 | # Default author to name of currently logged in user |
293 | 80 | try: | 80 | self.author.set_text(PlatformUtils.getFullName()) |
285 | 81 | # Try to get the full name if it exists | ||
286 | 82 | fullname = pwd.getpwuid(os.getuid())[4].split(",")[0] | ||
287 | 83 | if fullname == "": | ||
288 | 84 | fullname = pwd.getpwuid(os.getuid())[0] | ||
289 | 85 | self.author.set_text(fullname) | ||
290 | 86 | except: | ||
291 | 87 | # If we can't get the fullname, then just use the login | ||
292 | 88 | self.author.set_text(pwd.getpwuid(os.getuid())[0]) | ||
294 | 89 | 81 | ||
295 | 90 | self.okbutton = self.res.get_widget("okButton") | 82 | self.okbutton = self.res.get_widget("okButton") |
296 | 91 | self.okbutton.set_flags(gtk.CAN_DEFAULT) | 83 | self.okbutton.set_flags(gtk.CAN_DEFAULT) |
297 | @@ -132,13 +124,15 @@ | |||
298 | 132 | if not author: | 124 | if not author: |
299 | 133 | author = _("Unknown Author") | 125 | author = _("Unknown Author") |
300 | 134 | 126 | ||
302 | 135 | folder = self.folder.get_current_folder() | 127 | # CreateNewProject expects a URI |
303 | 128 | folder = PlatformUtils.pathname2url(self.folder.get_current_folder()) | ||
304 | 129 | |||
305 | 136 | # Save the selected folder as the default folder | 130 | # Save the selected folder as the default folder |
306 | 137 | Globals.settings.general["projectfolder"] = folder | 131 | Globals.settings.general["projectfolder"] = folder |
307 | 138 | Globals.settings.write() | 132 | Globals.settings.write() |
308 | 139 | if not folder: | 133 | if not folder: |
309 | 140 | folder = "~" | 134 | folder = "~" |
311 | 141 | 135 | ||
312 | 142 | try: | 136 | try: |
313 | 143 | project = ProjectManager.CreateNewProject(folder, name, author) | 137 | project = ProjectManager.CreateNewProject(folder, name, author) |
314 | 144 | except ProjectManager.CreateProjectError, e: | 138 | except ProjectManager.CreateProjectError, e: |
315 | 145 | 139 | ||
316 | === added directory 'Jokosher/PlatformUtils' | |||
317 | === added file 'Jokosher/PlatformUtils/Unix.py' | |||
318 | --- Jokosher/PlatformUtils/Unix.py 1970-01-01 00:00:00 +0000 | |||
319 | +++ Jokosher/PlatformUtils/Unix.py 2009-03-19 23:39:14 +0000 | |||
320 | @@ -0,0 +1,33 @@ | |||
321 | 1 | |||
322 | 2 | |||
323 | 3 | import os, os.path, urllib | ||
324 | 4 | import pwd | ||
325 | 5 | |||
326 | 6 | |||
327 | 7 | def getFullName(): | ||
328 | 8 | try: | ||
329 | 9 | # Try to get the full name if it exists | ||
330 | 10 | fullname = pwd.getpwuid(os.getuid())[4].split(",")[0] | ||
331 | 11 | if fullname == "": | ||
332 | 12 | fullname = pwd.getpwuid(os.getuid())[0] | ||
333 | 13 | return fullname | ||
334 | 14 | except: | ||
335 | 15 | # If we can't get the fullname, then just use the login | ||
336 | 16 | return pwd.getpwuid(os.getuid())[0] | ||
337 | 17 | |||
338 | 18 | def samefile(path1, path2): | ||
339 | 19 | return os.path.samefile(path1, path2) | ||
340 | 20 | |||
341 | 21 | |||
342 | 22 | def url2pathname(url): | ||
343 | 23 | return urllib.url2pathname(url) | ||
344 | 24 | |||
345 | 25 | def pathname2url(path): | ||
346 | 26 | return "file://%s" % urllib.pathname2url(path) | ||
347 | 27 | |||
348 | 28 | def GetRecordingDefaults(): | ||
349 | 29 | return dict() | ||
350 | 30 | |||
351 | 31 | def GetPlaybackDefaults(): | ||
352 | 32 | return dict() | ||
353 | 33 | |||
354 | 0 | 34 | ||
355 | === added file 'Jokosher/PlatformUtils/Windows.py' | |||
356 | --- Jokosher/PlatformUtils/Windows.py 1970-01-01 00:00:00 +0000 | |||
357 | +++ Jokosher/PlatformUtils/Windows.py 2009-03-19 23:39:14 +0000 | |||
358 | @@ -0,0 +1,33 @@ | |||
359 | 1 | |||
360 | 2 | |||
361 | 3 | import urllib | ||
362 | 4 | |||
363 | 5 | |||
364 | 6 | def getFullName(): | ||
365 | 7 | #TODO: Work out how to get the fullname in windows | ||
366 | 8 | return "" | ||
367 | 9 | |||
368 | 10 | def samefile(path1, path2): | ||
369 | 11 | return path1 == path2 | ||
370 | 12 | |||
371 | 13 | def url2pathname(url): | ||
372 | 14 | return urllib.url2pathname(url) | ||
373 | 15 | |||
374 | 16 | def pathname2url(path): | ||
375 | 17 | #Windows pathname2url appends // to the front of the path | ||
376 | 18 | return "file:%s" % urllib.pathname2url(path) | ||
377 | 19 | |||
378 | 20 | def GetRecordingDefaults(): | ||
379 | 21 | defaults = { | ||
380 | 22 | "fileformat": "vorbisenc ! oggmux", | ||
381 | 23 | "file_extension": "ogg", | ||
382 | 24 | "audiosrc" : "dshowaudiosrc" | ||
383 | 25 | } | ||
384 | 26 | return defaults | ||
385 | 27 | |||
386 | 28 | |||
387 | 29 | def GetPlaybackDefaults(): | ||
388 | 30 | defaults = { | ||
389 | 31 | "audiosink": "directsoundsink" | ||
390 | 32 | } | ||
391 | 33 | return defaults | ||
392 | 0 | 34 | ||
393 | === added file 'Jokosher/PlatformUtils/__init__.py' | |||
394 | --- Jokosher/PlatformUtils/__init__.py 1970-01-01 00:00:00 +0000 | |||
395 | +++ Jokosher/PlatformUtils/__init__.py 2009-03-19 23:44:15 +0000 | |||
396 | @@ -0,0 +1,10 @@ | |||
397 | 1 | |||
398 | 2 | import platform | ||
399 | 3 | |||
400 | 4 | system = platform.system() | ||
401 | 5 | |||
402 | 6 | if system == "Windows": | ||
403 | 7 | from Windows import * | ||
404 | 8 | else: | ||
405 | 9 | from Unix import * | ||
406 | 10 | |||
407 | 0 | 11 | ||
408 | === modified file 'Jokosher/Project.py' | |||
409 | --- Jokosher/Project.py 2009-03-17 02:09:31 +0000 | |||
410 | +++ Jokosher/Project.py 2009-03-26 15:07:44 +0000 | |||
411 | @@ -15,7 +15,7 @@ | |||
412 | 15 | pygst.require("0.10") | 15 | pygst.require("0.10") |
413 | 16 | import gst | 16 | import gst |
414 | 17 | import gobject | 17 | import gobject |
416 | 18 | import os | 18 | import os, os.path |
417 | 19 | import gzip | 19 | import gzip |
418 | 20 | import re | 20 | import re |
419 | 21 | 21 | ||
420 | @@ -27,6 +27,7 @@ | |||
421 | 27 | import Utils | 27 | import Utils |
422 | 28 | import AudioBackend | 28 | import AudioBackend |
423 | 29 | import ProjectManager | 29 | import ProjectManager |
424 | 30 | import PlatformUtils | ||
425 | 30 | 31 | ||
426 | 31 | #========================================================================= | 32 | #========================================================================= |
427 | 32 | 33 | ||
428 | @@ -392,13 +393,20 @@ | |||
429 | 392 | else: | 393 | else: |
430 | 393 | capsString = "audioconvert" | 394 | capsString = "audioconvert" |
431 | 394 | 395 | ||
435 | 395 | pipe = "%s ! %s ! level name=recordlevel interval=%d" +\ | 396 | # TODO: get rid of this entire string; do it manually |
436 | 396 | " ! audioconvert ! %s ! filesink location=%s" | 397 | pipe = "%s ! %s ! level name=recordlevel ! audioconvert ! %s ! filesink name=sink" |
437 | 397 | pipe %= (recordString, capsString, event.LEVEL_INTERVAL * gst.SECOND, encodeString, event.file.replace(" ", "\ ")) | 398 | pipe %= (recordString, capsString, encodeString) |
438 | 398 | 399 | ||
439 | 399 | Globals.debug("Using pipeline: %s" % pipe) | 400 | Globals.debug("Using pipeline: %s" % pipe) |
440 | 400 | 401 | ||
441 | 401 | recordingbin = gst.parse_bin_from_description(pipe, False) | 402 | recordingbin = gst.parse_bin_from_description(pipe, False) |
442 | 403 | |||
443 | 404 | filesink = recordingbin.get_by_name("sink") | ||
444 | 405 | level = recordingbin.get_by_name("recordlevel") | ||
445 | 406 | |||
446 | 407 | filesink.set_property("location", event.file) | ||
447 | 408 | level.set_property("interval", int(event.LEVEL_INTERVAL * gst.SECOND)) | ||
448 | 409 | |||
449 | 402 | #update the levels in real time | 410 | #update the levels in real time |
450 | 403 | handle = self.bus.connect("message::element", event.recording_bus_level) | 411 | handle = self.bus.connect("message::element", event.recording_bus_level) |
451 | 404 | 412 | ||
452 | @@ -605,15 +613,21 @@ | |||
453 | 605 | if instr.inTrack == index: | 613 | if instr.inTrack == index: |
454 | 606 | event = instr.GetRecordingEvent() | 614 | event = instr.GetRecordingEvent() |
455 | 607 | 615 | ||
456 | 616 | # TODO: get rid of string concatentation | ||
457 | 608 | encodeString = Globals.settings.recording["fileformat"] | 617 | encodeString = Globals.settings.recording["fileformat"] |
461 | 609 | pipe = "queue ! audioconvert ! level name=recordlevel interval=%d !" +\ | 618 | pipe = "queue ! audioconvert ! level name=recordlevel ! audioconvert ! %s ! filesink name=sink" |
462 | 610 | "audioconvert ! %s ! filesink location=%s" | 619 | pipe %= encodeString |
460 | 611 | pipe %= (event.LEVEL_INTERVAL * gst.SECOND, encodeString, event.file.replace(" ", "\ ")) | ||
463 | 612 | 620 | ||
464 | 613 | encodeBin = gst.parse_bin_from_description(pipe, True) | 621 | encodeBin = gst.parse_bin_from_description(pipe, True) |
465 | 614 | bin.add(encodeBin) | 622 | bin.add(encodeBin) |
466 | 615 | pad.link(encodeBin.get_pad("sink")) | 623 | pad.link(encodeBin.get_pad("sink")) |
467 | 616 | 624 | ||
468 | 625 | filesink = bin.get_by_name("sink") | ||
469 | 626 | level = bin.get_by_name("recordlevel") | ||
470 | 627 | |||
471 | 628 | filesink.set_property("location", event.file) | ||
472 | 629 | level.set_property("interval", int(event.LEVEL_INTERVAL * gst.SECOND)) | ||
473 | 630 | |||
474 | 617 | handle = self.bus.connect("message::element", event.recording_bus_level) | 631 | handle = self.bus.connect("message::element", event.recording_bus_level) |
475 | 618 | 632 | ||
476 | 619 | # since we are adding the encodebin to an already playing pipeline, sync up there states | 633 | # since we are adding the encodebin to an already playing pipeline, sync up there states |
477 | @@ -812,6 +826,8 @@ | |||
478 | 812 | os.remove(path + "~") | 826 | os.remove(path + "~") |
479 | 813 | else: | 827 | else: |
480 | 814 | #if the saving doesn't fail, move it to the proper location | 828 | #if the saving doesn't fail, move it to the proper location |
481 | 829 | if os.path.exists(path): | ||
482 | 830 | os.remove(path) | ||
483 | 815 | os.rename(path + "~", path) | 831 | os.rename(path + "~", path) |
484 | 816 | 832 | ||
485 | 817 | self.emit("undo") | 833 | self.emit("undo") |
486 | @@ -1306,10 +1322,12 @@ | |||
487 | 1306 | """ | 1322 | """ |
488 | 1307 | if not undoAction: | 1323 | if not undoAction: |
489 | 1308 | undoAction = self.NewAtomicUndoAction() | 1324 | undoAction = self.NewAtomicUndoAction() |
491 | 1309 | 1325 | ||
492 | 1326 | uris = [PlatformUtils.pathname2url(filename) for filename in fileList] | ||
493 | 1327 | |||
494 | 1310 | name, type, pixbuf, path = [x for x in Globals.getCachedInstruments() if x[1] == "audiofile"][0] | 1328 | name, type, pixbuf, path = [x for x in Globals.getCachedInstruments() if x[1] == "audiofile"][0] |
495 | 1311 | instr = self.AddInstrument(name, type, _undoAction_=undoAction) | 1329 | instr = self.AddInstrument(name, type, _undoAction_=undoAction) |
497 | 1312 | instr.AddEventsFromList(0, fileList, copyFile, undoAction) | 1330 | instr.AddEventsFromList(0, uris, copyFile, undoAction) |
498 | 1313 | 1331 | ||
499 | 1314 | #_____________________________________________________________________ | 1332 | #_____________________________________________________________________ |
500 | 1315 | 1333 | ||
501 | 1316 | 1334 | ||
502 | === modified file 'Jokosher/ProjectManager.py' | |||
503 | --- Jokosher/ProjectManager.py 2009-03-17 02:09:31 +0000 | |||
504 | +++ Jokosher/ProjectManager.py 2009-03-26 15:07:44 +0000 | |||
505 | @@ -14,6 +14,7 @@ | |||
506 | 14 | import Project, Instrument, Event | 14 | import Project, Instrument, Event |
507 | 15 | import xml.dom.minidom as xml | 15 | import xml.dom.minidom as xml |
508 | 16 | import traceback | 16 | import traceback |
509 | 17 | import PlatformUtils | ||
510 | 17 | 18 | ||
511 | 18 | def CreateNewProject(projecturi, name, author): | 19 | def CreateNewProject(projecturi, name, author): |
512 | 19 | """ | 20 | """ |
513 | @@ -33,6 +34,8 @@ | |||
514 | 33 | 34 | ||
515 | 34 | (scheme, domain,folder, params, query, fragment) = urlparse.urlparse(projecturi, "file", False) | 35 | (scheme, domain,folder, params, query, fragment) = urlparse.urlparse(projecturi, "file", False) |
516 | 35 | 36 | ||
517 | 37 | folder = PlatformUtils.url2pathname(folder) | ||
518 | 38 | |||
519 | 36 | if scheme != "file": | 39 | if scheme != "file": |
520 | 37 | # raise "The URI scheme used is invalid." message | 40 | # raise "The URI scheme used is invalid." message |
521 | 38 | raise CreateProjectError(5) | 41 | raise CreateProjectError(5) |
522 | @@ -114,6 +117,8 @@ | |||
523 | 114 | # raise "The URI scheme used is invalid." message | 117 | # raise "The URI scheme used is invalid." message |
524 | 115 | raise OpenProjectError(1, scheme) | 118 | raise OpenProjectError(1, scheme) |
525 | 116 | 119 | ||
526 | 120 | projectfile = PlatformUtils.url2pathname(projectfile) | ||
527 | 121 | |||
528 | 117 | Globals.debug("Attempting to open:", projectfile) | 122 | Globals.debug("Attempting to open:", projectfile) |
529 | 118 | 123 | ||
530 | 119 | if not os.path.exists(projectfile): | 124 | if not os.path.exists(projectfile): |
531 | 120 | 125 | ||
532 | === modified file 'Jokosher/Utils.py' | |||
533 | --- Jokosher/Utils.py 2009-03-12 15:26:43 +0000 | |||
534 | +++ Jokosher/Utils.py 2009-03-16 10:02:30 +0000 | |||
535 | @@ -16,8 +16,11 @@ | |||
536 | 16 | import Globals | 16 | import Globals |
537 | 17 | 17 | ||
538 | 18 | import gst | 18 | import gst |
540 | 19 | if gst.pygst_version >= (0, 10, 10): | 19 | try: |
541 | 20 | import gst.pbutils | 20 | import gst.pbutils |
542 | 21 | have_pbutils = True | ||
543 | 22 | except: | ||
544 | 23 | have_pbutils = False | ||
545 | 21 | 24 | ||
546 | 22 | # the highest range in decibels there can be between any two levels | 25 | # the highest range in decibels there can be between any two levels |
547 | 23 | DECIBEL_RANGE = 80 | 26 | DECIBEL_RANGE = 80 |
548 | @@ -125,7 +128,7 @@ | |||
549 | 125 | if not channelLevels: | 128 | if not channelLevels: |
550 | 126 | return 0 | 129 | return 0 |
551 | 127 | 130 | ||
553 | 128 | negInf = float("-inf") | 131 | negInf = -1E+5000 |
554 | 129 | peaktotal = 0 | 132 | peaktotal = 0 |
555 | 130 | for peak in channelLevels: | 133 | for peak in channelLevels: |
556 | 131 | #if peak > 0.001: | 134 | #if peak > 0.001: |
557 | @@ -380,8 +383,8 @@ | |||
558 | 380 | #_____________________________________________________________________ | 383 | #_____________________________________________________________________ |
559 | 381 | 384 | ||
560 | 382 | def HandleGstPbutilsMissingMessage(message, callback, x_window_id=0): | 385 | def HandleGstPbutilsMissingMessage(message, callback, x_window_id=0): |
563 | 383 | # pbutils was wrapped in 0.10.10 | 386 | # Not all platforms have pbutils |
564 | 384 | if gst.pygst_version < (0, 10, 10): | 387 | if not have_pbutils: |
565 | 385 | return False | 388 | return False |
566 | 386 | 389 | ||
567 | 387 | #self._installing_plugins = True | 390 | #self._installing_plugins = True |
568 | 388 | 391 | ||
569 | === modified file 'bin/jokosher' | |||
570 | --- bin/jokosher 2009-03-17 02:09:31 +0000 | |||
571 | +++ bin/jokosher 2009-03-26 14:19:15 +0000 | |||
572 | @@ -11,9 +11,17 @@ | |||
573 | 11 | # This script is also responsible for parsing comment line arguments. | 11 | # This script is also responsible for parsing comment line arguments. |
574 | 12 | # | 12 | # |
575 | 13 | #------------------------------------------------------------------------------- | 13 | #------------------------------------------------------------------------------- |
577 | 14 | import os, sys | 14 | import os, sys, platform |
578 | 15 | 15 | ||
580 | 16 | ENV_PATHS = {"JOKOSHER_DATA_PATH" : "/usr/share/jokosher/", | 16 | if platform.system() == "Windows": |
581 | 17 | ENV_PATHS = {"JOKOSHER_DATA_PATH" : ".\\", | ||
582 | 18 | "JOKOSHER_IMAGE_PATH" : ".\\pixmaps\\", | ||
583 | 19 | "JOKOSHER_LOCALE_PATH" : ".\\locale\\", | ||
584 | 20 | "JOKOSHER_HELP_PATH" : ".\\help\\", | ||
585 | 21 | "GST_PLUGIN_PATH" : ".\\" | ||
586 | 22 | } | ||
587 | 23 | else: | ||
588 | 24 | ENV_PATHS = {"JOKOSHER_DATA_PATH" : "/usr/share/jokosher/", | ||
589 | 17 | "JOKOSHER_IMAGE_PATH" : "/usr/share/jokosher/pixmaps/", | 25 | "JOKOSHER_IMAGE_PATH" : "/usr/share/jokosher/pixmaps/", |
590 | 18 | "JOKOSHER_LOCALE_PATH" : "/usr/share/locale/", | 26 | "JOKOSHER_LOCALE_PATH" : "/usr/share/locale/", |
591 | 19 | "JOKOSHER_HELP_PATH" : "/usr/share/gnome/jokosher/" | 27 | "JOKOSHER_HELP_PATH" : "/usr/share/gnome/jokosher/" |
592 | 20 | 28 | ||
593 | === removed file 'dist/jokosher-0.9.tar.gz' | |||
594 | 21 | Binary files dist/jokosher-0.9.tar.gz 2007-04-25 03:17:21 +0000 and dist/jokosher-0.9.tar.gz 1970-01-01 00:00:00 +0000 differ | 29 | Binary files dist/jokosher-0.9.tar.gz 2007-04-25 03:17:21 +0000 and dist/jokosher-0.9.tar.gz 1970-01-01 00:00:00 +0000 differ |
595 | === added file 'images/jokosher.ico' | |||
596 | 22 | Binary files images/jokosher.ico 1970-01-01 00:00:00 +0000 and images/jokosher.ico 2008-12-18 13:48:58 +0000 differ | 30 | Binary files images/jokosher.ico 1970-01-01 00:00:00 +0000 and images/jokosher.ico 2008-12-18 13:48:58 +0000 differ |
597 | === modified file 'setup.py' | |||
598 | --- setup.py 2009-03-17 02:09:31 +0000 | |||
599 | +++ setup.py 2009-03-26 15:07:44 +0000 | |||
600 | @@ -50,7 +50,7 @@ | |||
601 | 50 | license='GNU GPL', | 50 | license='GNU GPL', |
602 | 51 | platforms='linux', | 51 | platforms='linux', |
603 | 52 | scripts=['bin/jokosher'], | 52 | scripts=['bin/jokosher'], |
605 | 53 | packages=['Jokosher', 'Jokosher/elements', 'Jokosher/ui'], | 53 | packages=['Jokosher', 'Jokosher/elements', 'Jokosher/ui', 'Jokosher/PlatformUtils'], |
606 | 54 | data_files=[ | 54 | data_files=[ |
607 | 55 | ('share/jokosher/', glob.glob("Jokosher/*.glade")), | 55 | ('share/jokosher/', glob.glob("Jokosher/*.glade")), |
608 | 56 | ('share/jokosher/', ["Jokosher/jokosher-logo.png"]), | 56 | ('share/jokosher/', ["Jokosher/jokosher-logo.png"]), |
609 | 57 | 57 | ||
610 | === added file 'setup_win32.py' | |||
611 | --- setup_win32.py 1970-01-01 00:00:00 +0000 | |||
612 | +++ setup_win32.py 2009-03-26 15:07:44 +0000 | |||
613 | @@ -0,0 +1,41 @@ | |||
614 | 1 | #!/usr/bin/env python | ||
615 | 2 | |||
616 | 3 | from distutils.core import setup | ||
617 | 4 | from subprocess import * | ||
618 | 5 | import os | ||
619 | 6 | import glob | ||
620 | 7 | import py2exe | ||
621 | 8 | |||
622 | 9 | dist = setup(name='jokosher', | ||
623 | 10 | version='0.11.1', | ||
624 | 11 | author='Jokosher Project', | ||
625 | 12 | author_email='jokosher-devel@gnome.org', | ||
626 | 13 | maintainer='Michael Sheldon', | ||
627 | 14 | maintainer_email='mike@mikeasoft.com', | ||
628 | 15 | description='Multi-track non-linear audio editing.', | ||
629 | 16 | long_description='Jokosher is a simple yet powerful multi-track studio. With it you can create and record music, podcasts and more, all from an integrated simple environment.', | ||
630 | 17 | url='http://www.jokosher.org/', | ||
631 | 18 | download_url='http://www.jokosher.org/download', | ||
632 | 19 | license='GNU GPL', | ||
633 | 20 | packages=['Jokosher', 'Jokosher/elements', 'Jokosher/ui', 'Jokosher/PlatformUtils'], | ||
634 | 21 | windows = [ | ||
635 | 22 | { | ||
636 | 23 | 'script' : 'bin/jokosher', | ||
637 | 24 | 'icon_resources' : [(1, 'images/jokosher.ico')] | ||
638 | 25 | } | ||
639 | 26 | ], | ||
640 | 27 | options = { | ||
641 | 28 | 'py2exe': { | ||
642 | 29 | 'packages' : 'encodings, Jokosher, Jokosher.elements, Jokosher.ui', | ||
643 | 30 | 'includes' : 'cairo, gtk, gtk.glade, gobject, pango, pangocairo, atk, gst, pygst, xdg, Queue, xml.etree.ElementTree, gtk.keysyms, code, keyword, re' | ||
644 | 31 | } | ||
645 | 32 | }, | ||
646 | 33 | data_files=[ | ||
647 | 34 | "Jokosher\Jokosher.glade", | ||
648 | 35 | "Jokosher\jokosher-logo.png", | ||
649 | 36 | #glob.glob("Instruments\*.instr"), | ||
650 | 37 | #glob.glob('Instruments\images\*.png'), | ||
651 | 38 | #glob.glob("extensions\*.py") + glob.glob("extensions\*.egg"), | ||
652 | 39 | ] | ||
653 | 40 | ) | ||
654 | 41 | |||
655 | 0 | 42 | ||
656 | === added file 'windows_installer.iss' | |||
657 | --- windows_installer.iss 1970-01-01 00:00:00 +0000 | |||
658 | +++ windows_installer.iss 2009-03-26 14:19:15 +0000 | |||
659 | @@ -0,0 +1,13 @@ | |||
660 | 1 | [Setup] | ||
661 | 2 | AppName =Jokosher | ||
662 | 3 | AppVerName=Jokosher version 0.11.1 | ||
663 | 4 | DefaultDirName={pf}\Jokosher | ||
664 | 5 | DefaultGroupName=Jokosher | ||
665 | 6 | Compression=bzip/9 | ||
666 | 7 | |||
667 | 8 | [Files] | ||
668 | 9 | Source: dist/*; DestDir: {app}; Flags: recursesubdirs createallsubdirs | ||
669 | 10 | |||
670 | 11 | [Icons] | ||
671 | 12 | Name: {group}\Jokosher; Filename: {app}\jokosher.exe; WorkingDir: {app} | ||
672 | 13 | Name: {group}\Uninstall Jokosher; Filename: {uninstallexe} |