1"""
2 File:
3 JetDefs.py
4
5 Contents and purpose:
6 Holds definitions used throughout JetCreator
7
8 Copyright (c) 2008 Android Open Source Project
9
10 Licensed under the Apache License, Version 2.0 (the "License");
11 you may not use this file except in compliance with the License.
12 You may obtain a copy of the License at
13
14      http://www.apache.org/licenses/LICENSE-2.0
15
16 Unless required by applicable law or agreed to in writing, software
17 distributed under the License is distributed on an "AS IS" BASIS,
18 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 See the License for the specific language governing permissions and
20 limitations under the License.
21"""
22
23import wx
24
25class JetDefs():
26    def CreateHelpIniFile(self):
27        """ Used to create the help data file for context sensitive help """
28        self.CreateHelpIniForDialog("SEGDLG_CTRLS")
29        self.CreateHelpIniForDialog("EVTDLG_CTRLS")
30        self.CreateHelpIniForDialog("PREFERENCES_CTRLS")
31        self.CreateHelpIniForDialog("JET_PROPERTIES_CTRLS")
32        self.CreateHelpIniForDialog("REPLICATE_CTRLS")
33        self.CreateHelpIniForDialog("MOVE_CTRLS")
34
35    def CreateHelpIniForDialog(self, dlgName):
36        """ Used to create the help data file for context sensitive help """
37        print("\n" + dlgName)
38        lst = getattr(self, dlgName)
39        u = __import__('JetUtils')
40        for ctrl in lst:
41            fld = ctrl[0]
42            if fld[0:2] != "fr":
43                if u.IniGetValue(self.JETCREATOR_HLP, dlgName, fld) == "":
44                    u.IniSetValue(self.JETCREATOR_HLP, dlgName, fld, "")
45                    print(fld)
46
47    DEFAULT_MUTE_SYNC = False
48
49    TEMP_JET_DIR = "./Tmp/"
50    TEMP_JET_CONFIG_FILE = "./Tmp/Temp.jtc"
51    UNTITLED_FILE = "Untitled.jtc"
52    JETCREATOR_INI = "JetCreator.ini"
53    JETMIDIFILES_INI = "JetMidiFiles.ini"
54    JETCREATOR_HLP = "JetCreatorhlp.dat"
55
56    #Postevent message defines
57    PST_UPD_LOCATION = 1
58    PST_PLAY = 2
59    PST_DONE = 3
60    PST_PAUSE = 4
61    PST_RESUME = 5
62    PST_MIDI_INFO = 6
63
64    #Dialog titles and prompts
65    DLG_JETOPEN = "Open Jet File"
66    DLG_PREFERENCES = "Preferences"
67    DLG_ABOUT = "About"
68    DLG_PROPERTIES = "Jet Project Properties"
69    DLG_AUDITION = "Audition Jet File"
70    DLG_REPLICATE = "Replicate Event"
71    DLG_MOVE = "Move Events"
72    MAIN_TITLEPREFIX = 'Jet Creator - '
73    MAIN_DLG_CTRLS = 'JET_CREATOR'
74    MAIN_SEGLIST = 'segList'
75    MAIN_EVENTLIST = 'eventList'
76    MAIN_ADDSEGTITLE = "Add Segments"
77    MAIN_REVSEGTITLE = "Revise Segments"
78    MAIN_ADDEVENTTITLE = "Add Event"
79    MAIN_REVEVENTTITLE = "Revise Event"
80    MAIN_CONFIRM = "Confirm Deletion"
81    MAIN_CONFIRM_SEG_DLT = "\n\nOkay to delete segment(s)?"
82    MAIN_CONRIRM_EVT_DLT = "\n\nOkay to delete event(s)?"
83    MAIN_PLAYSEG = "Play Segments"
84    MAIN_PLAYSEGMSG = "Queue one or more segments by checking them in the list, then play."
85    MAIN_HELPTITLE = "Jet Creator Help"
86    MAIN_HELPFILE = "JET Creator User Manual.htm"
87    MAIN_HELPGUIDELINESTITLE = "Jet Authoring Guidelines"
88    MAIN_HELPGUIDELINESFILE = "JET Authoring Guidelines.htm"
89    MAIN_IMPORTTITLE = "Import Project"
90    MAIN_IMPORTMSG = "Okay to import\n\n%s\n\ninto\n\n%s?"
91    MAIN_SAVEBEFOREEXIT = "Save project before exiting?"
92    MAIN_JETCREATOR = "Jet Creator"
93
94    #Audition window defines
95    AUDITION_CTRLS = 'AUDITION_CTRLS'
96    AUDITION_SEGLIST = 'segList'
97    AUDITION_QUEUELIST = 'queueList'
98    AUDITION_TRACKLIST = 'trackList'
99    AUDITION_GRAPH = 'graph'
100
101    PLAY_TRIGGERCLIP_MSG = 'Triggered Clip %d: %s'
102
103    #Config file defines
104    RECENT_SECTION = "Recent"
105    DIR_SECTION = "Directories"
106    IMAGES_DIR = "ImagesDir"
107    INI_PREF_SECTION = "Preferences"
108    INI_PROJECT_DIRS = "chkProjectDir"
109    INI_LOGGING = "Logging"
110    INI_DEFAULTDIRS = "Directories"
111    INI_DISPEMPTYTRACKS = "DisplayEmptyTracks"
112    INI_EVENTSORT = "EventSort"
113    INI_EVENTSORT_0 = "EventSort0"
114    INI_EVENTSORT_1 = "EventSort1"
115    INI_SEGSORT = "SegSort"
116    INI_SEGSORT_0 = "SegSort0"
117    INI_SEGSORT_1 = "SegSort1"
118
119    #Mbt defines
120    MBT_DEFAULT = (0,0,0)
121    MBT_MIN = 0
122    MBT_ZEROSTR = "0:0:0"
123
124    #File open dialog specs
125    APPLICATION_TITLE = "Jet Creator"
126    MIDI_FILE_SPEC = 'MIDI Files (*.mid)|*.mid|All Files (*.*)|*.*'
127    DLS_FILE_SPEC = 'DLS Files (*.dls)|*.dls|All Files (*.*)|*.*'
128    JTC_FILE_SPEC = 'Jet Content Files (*.jtc)|*.jtc|All Files (*.*)|*.*'
129    ARCHIVE_FILE_SPEC = 'Jet Archive Files (*.zip)|*.zip|All Files (*.*)|*.*'
130    OPEN_PROMPT = "Open Jet Creator File"
131    SAVE_PROMPT = "Save Jet Creator File"
132    EXPORT_ARCHIVE_PROMPT = "Save Jet Archive"
133    MUST_SAVE_FIRST = "You must save your JetCreator project before exporting it."
134    IMPORT_ARCHIVE_PROMPT = "Select the Jet Archive to import"
135    IMPORT_ARCHIVEDIR_PROMPT = "Choose a directory:\n\nYour imported project files will be placed there."
136    IMPORT_ARCHIVE_NO_JTC = "This does not appear to be a JetCreator archive file."
137    IMPORT_NOT_JET_ARCHIVE = "Not a recognized Jet Archive file."
138
139    #Button texts
140    BUT_ADD = 'Add'
141    BUT_REVISE = 'Revise'
142    BUT_DELETE = 'Delete'
143    BUT_PLAY = 'Play'
144    BUT_STOP = 'Stop'
145    BUT_MOVE = 'Move'
146    BUT_QUEUEALL = 'Queue All'
147    BUT_DEQUEUEALL = 'Dequeue All'
148    BUT_UNMUTE = 'Un-Mute'
149    BUT_MUTE = 'Mute'
150    BUT_AUDITION = 'Audition'
151    BUT_QUEUE = 'Queue'
152    BUT_MUTEALL = 'Mute All'
153    BUT_MUTENONE = 'Mute None'
154    BUT_ORGMUTES = 'Original Mutes'
155    BUT_CANCELANDQUEUE = 'Cancel && Queue'
156    BUT_CANCELCURRENT = 'Next'
157    BUT_PAUSE = 'Pause'
158    BUT_RESUME = 'Resume'
159    BUT_PLAYSEG = 'Play Segment'
160    BUT_PLAYMIDI = 'Play MIDI File'
161
162    #Grid defines
163    GRD_TRACK = "Track"
164    GRD_CHANNEL = "Channel"
165    GRD_NAME = "Name"
166    GRD_SEGMENTS = "Segments"
167    GRD_LENGTH = "Length"
168    GRD_QUEUE = "Queue"
169    GRD_STATUS = "Status"
170
171    #Menu defines
172    MNU_ADD_SEG = "Add Segment"
173    MNU_UPDATE_SEG = "Revise Segment"
174    MNU_DELETE_SEG = "Delete Segment"
175    MNU_MOVE_SEG = "Move Segment(s)"
176    MNU_ADD_EVENT = "Add Event"
177    MNU_UPDATE_EVENT = "Revise Event"
178    MNU_DELETE_EVENT = "Delete Event"
179    MNU_MOVE_EVENT = "Move Events(s)"
180    MNU_UNDO = "Undo\tctrl+z"
181    MNU_REDO = "Redo\tctrl+y"
182
183    HLP_QUANTIZE = "The quantize element is optional and defaults to 0 if omitted.\nThis value sets a window size in ticks for the breaks in\n a segment when notes are extracted from a larger file. \nSee the section on Quantization for further detail \non the operation of this parameter."
184
185    #Status bar messages
186    SB_NEW = "New JET Creator file"
187    SB_OPEN = "Open JET Creator file"
188    SB_SAVE = "Save Jet Creator file and generate .JET output file"
189    SB_SAVEAS = "Save JET Creator file as another file"
190    SB_EXIT = "Exit the application"
191    SB_CUT = "Cuts the current segment or event to the clipboard"
192    SB_COPY = "Copies the current segment or event to the clipboard"
193    SB_PASTE = "Pastes the current segment or event from the clipboard"
194    SB_UNDO = "Undo the last segment or event edit."
195    SB_REDO = "Reverse the last segment or event undo edit."
196    SB_IMPORT_PROJ = "Imports a JetCreator project archive."
197    SB_EXPORT_PROJ = "Saves all project files to an archive."
198
199    #Defines the menus
200    MENU_SPEC = (("&File",
201                    ("&New", SB_NEW, 'OnJetNew', True),
202                    ("&Open...", SB_OPEN, 'OnJetOpen', True),
203                    ("&Save", SB_SAVE, 'OnJetSave', True),
204                    ("Save As...", SB_SAVEAS, 'OnJetSaveAs', True),
205                    ("", "", "", True),
206                    ("Import Project...", SB_IMPORT_PROJ, "OnJetImportArchive", True),
207                    ("Export Project...", SB_EXPORT_PROJ, "OnJetExportArchive", True),
208                    ("Properties...", "Sets properties specific to this Jet project", 'OnJetProperties', True),
209                    ("", "", "", True),
210                    ("Exit", SB_EXIT, 'OnClose', True)),
211                ("&Edit",
212                    (MNU_UNDO, "Undo", 'OnUndo', False),
213                    (MNU_REDO, "Redo", 'OnRedo', False),
214                    ("C&ut\tctrl+x", "Cut", 'OnCut', True),
215                    ("&Copy\tctrl+c", "Copy", 'OnCopy', True),
216                    ("&Paste\tctrl+v", "Paste", 'OnPaste', True)),
217                ("Jet",
218                    ("Preferences", "Set user preferences including defaults for new project files.", 'OnPreferences', True)),
219                ("Segments",
220                    (MNU_ADD_SEG, "Add a new segment to the segment list", 'OnSegmentAdd', True),
221                    (MNU_UPDATE_SEG, "Revise the segment attributes", 'OnSegmentUpdate', False),
222                    (MNU_DELETE_SEG, "Delete the segment from the segment list", 'OnSegmentDelete', False),
223                    (MNU_MOVE_SEG, "Move one or more segments by incrementing or decrementing their time values", 'OnSegmentsMove', False)),
224                ("Events",
225                    (MNU_ADD_EVENT, "Add a new event for the currently selected segment", 'OnEventAdd', False),
226                    (MNU_UPDATE_EVENT, "Revise the current event's attributes", 'OnEventUpdate', False),
227                    (MNU_DELETE_EVENT, "Delete the event from the event list for this segment", 'OnEventDelete', False),
228                    (MNU_MOVE_EVENT, "Move one or more events by incrementing or decrementing their time values", 'OnEventsMove', False)),
229                ("Help",
230                    ("JET Creator User Manual", "Get help on the JET Creator", "OnHelpJet", True),
231                    ("JET Authoring Guidelines", "Guidelines helpful for JET content creation", "OnHelpJetGuidelines", True),
232                    ("About", "About the JET Creator", "OnAbout", True))
233                    )
234
235    #Define the toolbar
236    TOOLBAR_SPEC = (
237                    ("-", "", "", ""),
238                    ("New", "img_New", SB_NEW, "OnJetNew"),
239                    ("Open", "img_Open", SB_OPEN, "OnJetOpen"),
240                    ("Save", "img_Save", SB_SAVE, "OnJetSave"),
241                    ("-", "", "", ""),
242                    ("Cut", "img_Cut", SB_CUT, "OnCut"),
243                    ("Copy", "img_Copy", SB_COPY, "OnCopy"),
244                    ("Paste", "img_Paste", SB_PASTE, "OnPaste"),
245                    ("-", "", "", ""),
246                    ("Undo", "img_Undo", SB_UNDO, "OnUndo"),
247                    ("Redo", "img_Redo", SB_REDO, "OnRedo"),
248                    )
249
250    F_HLPBUT = "hlpButton"
251    F_OK = "btnOk"
252    F_CANCEL = "btnCancel"
253    F_MIDIFILE = "filecmbMidiFile"
254    F_DLSFILE = "filecmbDlsFile"
255    F_SEGNAME = "txtSegName"
256    F_START = "tmStart"
257    F_END = "tmEnd"
258    F_QUANTIZE = "spnQuantize"
259    F_REPEAT = "spnRepeat"
260    F_TRANSPOSE = "spnTranspose"
261    F_MUTEFLAGS = "grd2MuteFlags"
262    F_SYNCMUTE = "chkSync"
263    F_ETYPE = "cmbEventType"
264    F_ENAME = "txtEventName"
265    F_ESTART = "tmEventStart"
266    F_EEND = "tmEventEnd"
267    F_EID = "spnEventID"
268    F_ETRACK = "spnEventTrack"
269    F_ECHANNEL = "spn1EventChannel"
270    F_EEVENTID = "spnEventID"
271    F_EMUTEBUT = "btnMute"
272    F_ETRIGGERBUT = "btnTriggerClip"
273    F_GRAPH = "graphPlay"
274    F_PAUSE = "btnPause"
275    F_ADDSEG = "btnAddSeg"
276    F_UPDSEG = "btnUpdateSeg"
277    F_DELSEG = "btnDeleteSeg"
278    F_PLAY = "btnPlay"
279    F_PLAYMIDI = "btnPlayMidi"
280    F_EASPLAY = "btnEasPlay"
281    F_ADDCLIP = "btnAddEvent"
282    F_UPDCLIP = "btnUpdateEvent"
283    F_DELCLIP = "btnDeleteEvent"
284    F_EXPORT = "btnOkExport"
285    F_JETFILENAME = "filecmbJetFileName"
286    F_COPYRIGHT = "txtCopyright"
287    F_JFILE = "filetxtJetFileName"
288    F_JOPEN = "btnOpen"
289    F_JNEW = "btnNew"
290    F_JIMPORT = "btnImport"
291    F_JLIST = "lstRecent"
292    F_ERRGRID = "grdErrors"
293    F_CHASECONTROLLERS = "chkChaseControllers"
294    F_DELETEEMPTYTRACKS = "chkDeleteEmptyTracks"
295    F_OPTMIDI = "optMidiGraph"
296    F_OPTSEG = "optSegGraph"
297    F_RDOGRAPH = "rdoboxGraphType"
298    F_DISPEMPTYTRACKS = "chkDisplayEmptyTracks"
299    F_GRAPHLABELS = "chkGraphLabels"
300    F_GRAPHCLIPS = "chkGraphClips"
301    F_GRAPHAPPEVTS = "chkGraphAppEvts"
302    F_REPLICATE = "btnReplicate"
303
304    GRAPH_LBLS = "Labels"
305    GRAPH_TRIGGER = "Trigger Clips"
306    GRAPH_APP = "App Events"
307
308    #IDs for dialogs
309    ID_JET_OPEN = 0
310    ID_JET_NEW = 1
311    ID_JET_IMPORT = 2
312
313    #Event types
314    E_CLIP = 'TriggerClip'
315    E_EOS = 'End of Segment'
316    E_APP = 'App Controller'
317
318    INTWIDTH = 70
319    TIMEWIDTH = 70
320
321    #Definitions of fields in the edit frame
322    TM_WIDTH = 100
323    TRACK_MIN = 1
324    TRACK_MAX = 32
325    EVENTID_MIN = 1
326    EVENTID_MAX = 63
327    APPCONTROLLERID_MIN = 80
328    APPCONTROLLERID_MAX = 83
329    #NEEDS TO DEFAULT TO RANGE OF BOTH POSSIBLE TYPES
330    DEFAULTID_MIN = 1
331    DEFAULTID_MAX = 100
332
333    #Mins and maxs for dialog values
334    QUANTIZE_MIN = 0
335    QUANTIZE_MAX = 9
336    CHANNEL_MIN = 1
337    CHANNEL_MAX = 16
338    TRANSPOSE_MIN = -12
339    TRANSPOSE_MAX = 12
340    REPEAT_MIN = -1
341    REPEAT_MAX = 100
342
343    #Standardize the columns
344    BUTSIZE = wx.DefaultSize
345    COLSIZE = 120
346    COL1 = 30
347    COL2 = COL1 + COLSIZE
348    COL3 = COL2 + COLSIZE
349    COL4 = COL3 + COLSIZE
350    COL5 = COL4 + COLSIZE
351    COL6 = COL5+ COLSIZE
352    COL7 = COL6 + COLSIZE
353    ROWSIZE = 50
354    ROW1 = 40
355    ROW2 = ROW1 + ROWSIZE
356    ROW3 = ROW2 + ROWSIZE
357    ROW4 = ROW3 + ROWSIZE
358    ROW5 = ROW4 + ROWSIZE
359    ROW6 = ROW5 + ROWSIZE
360    ROW7 = ROW6 + ROWSIZE
361    BUTOFF = 25
362    BUTROW1 = 25
363    FILEPATH_GRIDWIDTH = 120
364    FILEPATH_WIDTH = 250
365
366    #Segment grid column definitions
367    SEGMENT_GRID = [('Segment Name', 200, F_SEGNAME),
368                    ('MIDI File', FILEPATH_GRIDWIDTH, F_MIDIFILE),
369                    ('DLS File', FILEPATH_GRIDWIDTH, F_DLSFILE),
370                    ('Start', TIMEWIDTH, F_START),
371                    ('End', TIMEWIDTH, F_END),
372                    ('Quantize', 0, F_QUANTIZE),
373                    ('Transpose', 0, F_TRANSPOSE),
374                    ('Repeat', 0, F_REPEAT),
375                    ('Mute Flags', 0, F_MUTEFLAGS)
376                   ]
377
378    #Clips grid column definitions
379    CLIPS_GRID =   [('Event Name', 200, F_ENAME),
380                    ('Type', 100, F_ETYPE),
381                    ('Start',TIMEWIDTH, F_ESTART),
382                    ('End',TIMEWIDTH, F_EEND),
383                    ('Track',0, F_ETRACK),
384                    ('Channel',0, F_ECHANNEL),
385                    ('EventID',0, F_EEVENTID)
386                   ]
387
388    #Jet open dialog control definitions
389    JETOPEN_SIZE = (365+200,360)
390    JETOPEN_CTRLS = [
391             ('Jet Creator Files', 'frCreator', 20, 20, (234+200, 244 + ROWSIZE), 0, 0, -1, [], "", True, ""),
392             ('Open', F_JOPEN, BUTROW1, COL3+200, BUTSIZE, 0, 0, ID_JET_OPEN, [], "OnOk", True, ""),
393             ('New', F_JNEW, BUTROW1+BUTOFF*1, COL3+200, BUTSIZE, 0, 0, ID_JET_NEW, [], "OnNew", True, ""),
394             ('Import', F_JIMPORT, BUTROW1+BUTOFF*2, COL3+200, BUTSIZE, 0, 0, ID_JET_IMPORT, [], "OnJetImport", True, ""),
395             ('Cancel', F_CANCEL, BUTROW1+BUTOFF*3, COL3+200, BUTSIZE, 0, 0, wx.ID_CANCEL, [], "", True, ""),
396             ('', F_JFILE, ROW1, COL1, 200+200, 0, 0, -1, JTC_FILE_SPEC, "", True, ""),
397             ('Recent Files', F_JLIST, ROW2, COL1, (200+200,200), 0, 0, -1, [], "", True, ""),
398             ]
399
400    #Jet properties dialog control definitions
401    JET_PROPERTIES_SIZE = (465,460)
402    JET_PROPERTIES_CTRLS = [
403             ('Jet Project Properties', 'frProperties', 20, 20, (334, 344 + ROWSIZE), 0, 0, -1, [], "", True, ""),
404             ('Ok', F_OK, BUTROW1, COL3+100, BUTSIZE, 0, 0, wx.ID_OK, [], "OnOk", True, ""),
405             ('Cancel', F_CANCEL, BUTROW1+BUTOFF*1, COL3+100, BUTSIZE, 0, 0, wx.ID_CANCEL, [], "", True, ""),
406             ('Jet File', F_JETFILENAME, ROW1, COL1, 300, 0, 0, -1, JTC_FILE_SPEC, "", True, ""),
407             ('Copyright', F_COPYRIGHT, ROW2, COL1, 300, 0, 0, -1, [], "", True, ""),
408             ('Chase Controllers', F_CHASECONTROLLERS, ROW3, COL1, 200, 0, 0, -1, [], "", True, ""),
409             ('Delete Empty Tracks', F_DELETEEMPTYTRACKS, ROW4 - ROWSIZE/2, COL1, 200, 0, 0, -1, [], "", True, ""),
410             ]
411
412    #Preferences dialog control definitions
413    PREFERENCES_SIZE = (465,460)
414    PREFERENCES_CTRLS = [
415             ('Preferences', 'frPreferences', 20, 20, (334, 344 + ROWSIZE), 0, 0, -1, [], "", True, ""),
416             ('Ok', F_OK, BUTROW1, COL3+100, BUTSIZE, 0, 0, wx.ID_OK, [], "OnOk", True, ""),
417             ('Cancel', F_CANCEL, BUTROW1+BUTOFF*1, COL3+100, BUTSIZE, 0, 0, wx.ID_CANCEL, [], "", True, ""),
418             ('Copyright', F_COPYRIGHT, ROW1, COL1, 300, 0, 0, -1, [], "", True, ""),
419             ('Chase Controllers', F_CHASECONTROLLERS, ROW2, COL1, 200, 0, 0, -1, [], "", True, ""),
420             ('Delete Empty Tracks', F_DELETEEMPTYTRACKS, ROW3 - ROWSIZE/2, COL1, 200, 0, 0, -1, [], "", True, ""),
421#             ('Use Project Directories', INI_PROJECT_DIRS, ROW1, COL1, 150, 0, 0, -1, [], "", True, ""),
422             ]
423
424    #Error dialog control definitions
425    ERRORCOLW = 220
426    ERRORDLG_SIZE = (600,400)
427    ERRORDLG = [
428             ('Ok', F_OK, BUTROW1, 500, BUTSIZE, 0, 0, wx.ID_OK, [], "OnOk", True, ""),
429             ('', F_ERRGRID, BUTROW1, COL1, (200,300), 0, 0, -1, [], "", True, ""),
430             ]
431
432    #Event dialog control definitions
433    BGR = 100
434    EVT_OFFSET = 525+BGR
435    EVTDLG_SIZE = (375+EVT_OFFSET,530)
436    ID_MUTE = 124
437    ID_MIDIFILE = 123
438    ID_TRIGGERCLIP = 122
439    SEGFRAME_SIZE = (500+BGR, 344 + ROWSIZE)
440    TRACKGRD_SIZE = (70, SEGFRAME_SIZE[1]-50)
441    GRAPH_SIZE = (760, 50)
442    AUDCOL=190
443    EVTDLG_CTRLS = [
444             ('Segment', 'frSeg', 20, 20, SEGFRAME_SIZE, 0, 0, -1, [], "", False, ""),
445             ('Segment Name', F_SEGNAME, ROW1, COL1, 200+BGR, 0, 0, -1, [], "", False, ""),
446             ('MIDI File', F_MIDIFILE, ROW2, COL1, FILEPATH_WIDTH+BGR, 0, 0, ID_MIDIFILE, MIDI_FILE_SPEC, "", False, ""),
447             ('DLS File', F_DLSFILE, ROW3, COL1, FILEPATH_WIDTH+BGR, 0, 0, -1, DLS_FILE_SPEC, "", False, ""),
448             ('Starting M/B/T', F_START, ROW4, COL1, TM_WIDTH, 0, 0, -1, [], "", False, ""),
449             ('Ending M/B/T', F_END, ROW5, COL1, TM_WIDTH, 0, 0, -1, [], "", False, ""),
450             ('Quantize', F_QUANTIZE, ROW6, COL1, INTWIDTH, QUANTIZE_MIN, QUANTIZE_MAX, -1, [], "", False, HLP_QUANTIZE),
451             ('Repeat', F_REPEAT, ROW4, AUDCOL, INTWIDTH, REPEAT_MIN, REPEAT_MAX, -1, [], "", False, ""),
452             ('Transpose', F_TRANSPOSE, ROW5, AUDCOL, INTWIDTH, TRANSPOSE_MIN, TRANSPOSE_MAX, -1, [], "", False, ""),
453             ('Event', 'frEventg', 20+EVT_OFFSET, 20, (234, 344 + ROWSIZE), 0, 0, -1, [], "", True, ""),
454             ('Ok', F_ADDCLIP, BUTROW1, COL3+EVT_OFFSET, BUTSIZE, 0, 0, wx.ID_OK, [], "OnOk", True, ""),
455             ('Cancel', F_CANCEL, BUTROW1+BUTOFF*1, COL3+EVT_OFFSET, BUTSIZE, 0, 0, wx.ID_CANCEL, [], "OnClose", True, ""),
456             ('Replicate', F_REPLICATE, BUTROW1+BUTOFF*2, COL3+EVT_OFFSET, BUTSIZE, 0, 0, wx.ID_CANCEL, [], "OnReplicate", True, ""),
457             ('Event Name', F_ENAME, ROW1, COL1+EVT_OFFSET, 200, 0, 0, -1, [], "", True, ""),
458             ('Event Type', F_ETYPE, ROW2, COL1+EVT_OFFSET, 120, 0, 0, -1, [E_CLIP, E_EOS, E_APP], "OnEventSelect", True, ""),
459             ('Starting M/B/T', F_ESTART, ROW3, COL1+EVT_OFFSET, TM_WIDTH, 0, 0, -1, [], "", True, ""),
460             ('Ending M/B/T', F_EEND, ROW4, COL1+EVT_OFFSET, TM_WIDTH, 0, 0, -1, [], "", True, ""),
461             ('Track', F_ETRACK, ROW5, COL1+EVT_OFFSET, INTWIDTH, TRACK_MIN, TRACK_MAX, -1, [], "", True, ""),
462             ('Track Mutes', F_MUTEFLAGS, ROW1, COL3 + 15+BGR, TRACKGRD_SIZE, 0, 0, -1, [], "", False, ""),
463             ('Channel', F_ECHANNEL, ROW6, COL1+EVT_OFFSET, INTWIDTH, CHANNEL_MIN, CHANNEL_MAX, -1, [], "", True, ""),
464             ('EventID', F_EEVENTID, ROW7, COL1+EVT_OFFSET, INTWIDTH, DEFAULTID_MIN, DEFAULTID_MAX, -1, [], "", True, ""),
465             ('Play', F_PLAY, BUTROW1+BUTOFF*4, COL3+EVT_OFFSET, BUTSIZE, 0, 0, -1, [], "OnPlay", True, ""),
466             ('Trigger', F_ETRIGGERBUT, BUTROW1+BUTOFF*5, COL3+EVT_OFFSET, BUTSIZE, 0, 0, ID_TRIGGERCLIP, [], "OnTriggerClip", False, ""),
467             ('Un-Mute', F_EMUTEBUT, BUTROW1+BUTOFF*6, COL3+EVT_OFFSET, BUTSIZE, 0, 0, ID_MUTE, [], "OnMute", False, ""),
468             ('Pause', F_PAUSE, BUTROW1+BUTOFF*7, COL3+EVT_OFFSET, BUTSIZE, 0, 0, -1, [], "OnPause", False, ""),
469             ('Graph', F_GRAPH, 430, 20, (EVTDLG_SIZE[0]-40,60), 0, 0, -1, [], "", True, ""),
470             (GRAPH_LBLS, F_GRAPHLABELS, (BUTROW1+BUTOFF*10)+70, COL3+EVT_OFFSET+5, 200, 0, 0, -1, [], "OnSetGraphOptions", True, ""),
471             (GRAPH_APP, F_GRAPHCLIPS, (BUTROW1+BUTOFF*10)+90, COL3+EVT_OFFSET+5, 200, 0, 0, -1, [], "OnSetGraphOptions", True, ""),
472             (GRAPH_TRIGGER, F_GRAPHAPPEVTS, (BUTROW1+BUTOFF*10)+110, COL3+EVT_OFFSET+5, 200, 0, 0, -1, [], "OnSetGraphOptions", True, ""),
473             ("Graph", "boxGraph", (BUTROW1+BUTOFF*10)+45, COL3+EVT_OFFSET, (90,95), 0, 0, -1, [], "", True, ""),
474
475          ]
476
477    #Segment dialog control definitions
478    BGR = 100
479    AUDCOL = 560
480    COLADD = 500 + BGR
481    SEGDLG_SIZE = (890+BGR,530)
482    SEGFRAME_SIZE = (375+BGR, 394)
483    AUDFRAME_SIZE = (350, 394)
484    TRACKGRD_SIZE = (200, AUDFRAME_SIZE[1]-60)
485    MUTEGRD_TRACK = 50
486    MUTEGRD_CHANNEL = 60
487    MUTEGRD_NAME = 100
488    BIGBUT = (100, 25)
489    FILEPATH_WIDTH = 350
490    SEGDLG_CTRLS = [
491             ('Segment', 'frSeg', 20, 20, SEGFRAME_SIZE, 0, 0, -1, [], "", True, ""),
492             ('Audition', 'frAudition', SEGFRAME_SIZE[0]+30, 20, AUDFRAME_SIZE, 0, 0, -1, [], "", True, ""),
493             ('Segment Name', F_SEGNAME, ROW1, COL1, 200+BGR, 0, 0, -1, [], "", True, ""),
494             ('MIDI File', F_MIDIFILE, ROW2, COL1, FILEPATH_WIDTH+BGR, 0, 0, ID_MIDIFILE, MIDI_FILE_SPEC, "", True, ""),
495             ('DLS File', F_DLSFILE, ROW3, COL1, FILEPATH_WIDTH+BGR, 0, 0, -1, DLS_FILE_SPEC, "", True, ""),
496             ('Starting M/B/T', F_START, ROW4, COL1, TM_WIDTH, 0, 0, -1, [], "", True, ""),
497             ('Ending M/B/T', F_END, ROW5, COL1, TM_WIDTH, 0, 0, -1, [], "", True, ""),
498             ('Quantize', F_QUANTIZE, ROW6, COL1, INTWIDTH, QUANTIZE_MIN, QUANTIZE_MAX, -1, [], "", True, HLP_QUANTIZE),
499             ('Repeat', F_REPEAT, ROW1, AUDCOL+100+BGR, INTWIDTH, REPEAT_MIN, REPEAT_MAX, -1, [], "", True, ""),
500             ('Transpose', F_TRANSPOSE, ROW2, AUDCOL+100+BGR, INTWIDTH, TRANSPOSE_MIN, TRANSPOSE_MAX, -1, [], "", True, ""),
501             ('Track Mutes', F_MUTEFLAGS, ROW1, COL3 + 145+BGR, TRACKGRD_SIZE, 0, 0, -1, [], "", True, ""),
502             ('Display Empty Tracks', F_DISPEMPTYTRACKS, ROW1+TRACKGRD_SIZE[1]+20, COL3 + 145+BGR, 200, 0, 0, -1, [], "OnSetTrackDisplayOption", True, ""),
503             ('Ok', F_ADDSEG, BUTROW1, COL3 + COLADD, BIGBUT, 0, 0, wx.ID_OK, [], "OnOk", True, ""),
504             ('Cancel', F_CANCEL, BUTROW1+BUTOFF*1, COL3 + COLADD, BIGBUT, 0, 0, wx.ID_CANCEL, [], "OnClose", True, ""),
505             ('Replicate', F_REPLICATE, BUTROW1+BUTOFF*2, COL3 + COLADD, BIGBUT, 0, 0, wx.ID_CANCEL, [], "OnReplicate", True, ""),
506
507             ('Play Segment', F_PLAY, BUTROW1+BUTOFF*4, COL3 + COLADD, BIGBUT, 0, 0, -1, [], "OnPlay", True, ""),
508             ('Play MIDI File', F_PLAYMIDI, BUTROW1+BUTOFF*5, COL3 + COLADD, BIGBUT, 0, 0, -1, [], "OnPlayMidi", True, ""),
509             ('Pause', F_PAUSE, BUTROW1+BUTOFF*6, COL3 + COLADD, BIGBUT, 0, 0, -1, [], "OnPause", False, ""),
510             ('Graph', F_GRAPH, 430, 20, (SEGDLG_SIZE[0]-40,60), 0, 0, -1, [], "", True, ""),
511             ('Graph', F_RDOGRAPH, (BUTROW1+BUTOFF*10), COL3 + COLADD, (100,140), 0, 0, -1, ["MIDI File", "Segment"], "OnSetGraphType", True, ""),
512
513             (GRAPH_LBLS, F_GRAPHLABELS, (BUTROW1+BUTOFF*10)+70, COL3 + COLADD+5, 200, 0, 0, -1, [], "OnSetGraphOptions", True, ""),
514             (GRAPH_APP, F_GRAPHCLIPS, (BUTROW1+BUTOFF*10)+90, COL3 + COLADD+5, 200, 0, 0, -1, [], "OnSetGraphOptions", True, ""),
515             (GRAPH_TRIGGER, F_GRAPHAPPEVTS, (BUTROW1+BUTOFF*10)+110, COL3 + COLADD+5, 200, 0, 0, -1, [], "OnSetGraphOptions", True, ""),
516             ]
517
518
519    REPLICATE_MAX = 999
520    F_RPINCREMENT = "tmIncrement"
521    F_RPGRDPREVIEW = "grdPreview"
522    F_RPPREFIX = "txtPrefix"
523    F_RPREPLACE = "chkReplaceMatching"
524    F_RPMOVE = "chkMoveMatching"
525    F_RPNUMBER = "spnNumber"
526    F_RPBUT = "btnPreview"
527    REPLICATE_GRID =   [('Event Name', 200, F_ENAME),
528                        ('Start',TIMEWIDTH, F_ESTART),
529                        ('End',TIMEWIDTH, F_EEND)
530                        ]
531    REPLICATE_SIZE = (515,550)
532    REPLICATEGRID_SIZE = (350,310)
533    REPLICATE_CTRLS = [
534             ('Replicate', 'frRep', 20, 20, (384, 480), 0, 0, -1, [], "", True, ""),
535             ('Ok', F_OK, BUTROW1, COL3+150, BUTSIZE, 0, 0, wx.ID_OK, [], "OnOk", True, ""),
536             ('Cancel', F_CANCEL, BUTROW1+BUTOFF*1, COL3+150, BUTSIZE, 0, 0, wx.ID_CANCEL, [], "", True, ""),
537             ('Preview', F_RPBUT , BUTROW1+BUTOFF*2, COL3+150, BUTSIZE, 0, 0, -1, [], "OnPreview", True, ""),
538             ('Name Prefix', F_RPPREFIX, ROW1, COL1, 300, 0, 0, -1, [], "", True, ""),
539             ('Replace Existing Items Matching Prefix', F_RPREPLACE, ROW3, COL1, 200, 0, 0, -1, [], "", True, ""),
540             ('Preview', F_RPGRDPREVIEW, ROW4-20, COL1, REPLICATEGRID_SIZE, 0, 0, -1, [], "", True, ""),
541             ('Starting M/B/T', F_ESTART, ROW2, COL1, TM_WIDTH, 0, 0, -1, [], "", True, ""),
542             ('Increment M/B/T', F_RPINCREMENT, ROW2, COL2+20, TM_WIDTH, 0, 0, -1, [], "", True, ""),
543             ('Number', F_RPNUMBER, ROW2, COL3+40, INTWIDTH, 1, REPLICATE_MAX, -1, [], "", True, ""),
544             ]
545
546
547    MOVE_SIZE = (350,390)
548    MOVE_CTRLS = [
549             ('Move', 'frRep', 20, 20, (384, 480), 0, 0, -1, [], "", True, ""),
550             ('Ok', F_OK, BUTROW1, COL3+150, BUTSIZE, 0, 0, wx.ID_OK, [], "OnOk", True, ""),
551             ('Cancel', F_CANCEL, BUTROW1+BUTOFF*1, COL3+150, BUTSIZE, 0, 0, wx.ID_CANCEL, [], "", True, ""),
552             ('Preview', F_RPBUT , BUTROW1+BUTOFF*2, COL3+150, BUTSIZE, 0, 0, -1, [], "OnPreview", True, ""),
553             ('Starting M/B/T', F_ESTART, ROW1, COL1, TM_WIDTH, 0, 0, -1, [], "", True, ""),
554             ('Increment M/B/T', F_RPINCREMENT, ROW1, COL2+20, TM_WIDTH, 0, 0, -1, [], "", True, ""),
555             ('Preview', F_RPGRDPREVIEW, ROW2, COL1, MOVE_SIZE, 0, 0, -1, [], "", True, ""),
556             ]
557
558if __name__ == '__main__':
559    jd = JetDefs()
560    jd.CreateHelpIniFile()
561