summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Michel Trivi <>2009-04-04 01:25:54 (GMT)
committerThe Android Open Source Project <initial-contribution@android.com>2009-04-04 01:25:54 (GMT)
commit6b065d0f7161fe54e6f58fd2b8ad6c650b2d3657 (patch)
tree743a03c5e06fab24cb940fdaf236875f73453501
parent9bdfa57352c68c2060fb37fcc3aa5b6d20e0dec1 (diff)
downloadandroid_external_sonivox-6b065d0f7161fe54e6f58fd2b8ad6c650b2d3657.zip
android_external_sonivox-6b065d0f7161fe54e6f58fd2b8ad6c650b2d3657.tar.gz
android_external_sonivox-6b065d0f7161fe54e6f58fd2b8ad6c650b2d3657.tar.bz2
AI 144576: am: CL 144575 am: CL 144573 Checking in Sonivox' JetCreator code.
Original author: jmtrivi Merged from: //branches/cupcake/... Original author: android-build Automated import of CL 144576
-rwxr-xr-xjet_tools/JetCreator/JetAudition.py509
-rwxr-xr-xjet_tools/JetCreator/JetCreator.py1431
-rwxr-xr-xjet_tools/JetCreator/JetCreatorhlp.dat119
-rwxr-xr-xjet_tools/JetCreator/JetCtrls.py567
-rwxr-xr-xjet_tools/JetCreator/JetDebug.py71
-rwxr-xr-xjet_tools/JetCreator/JetDefs.py560
-rwxr-xr-xjet_tools/JetCreator/JetDialogs.py1031
-rwxr-xr-xjet_tools/JetCreator/JetFile.py775
-rwxr-xr-xjet_tools/JetCreator/JetHelp.py33
-rwxr-xr-xjet_tools/JetCreator/JetPreview.py200
-rwxr-xr-xjet_tools/JetCreator/JetSegGraph.py361
-rwxr-xr-xjet_tools/JetCreator/JetStatusEvent.py38
-rwxr-xr-xjet_tools/JetCreator/JetSystemInfo.py40
-rwxr-xr-xjet_tools/JetCreator/JetUtils.py788
-rwxr-xr-xjet_tools/JetCreator/ReadMe1st.txt44
-rwxr-xr-xjet_tools/JetCreator/eas.py1229
-rwxr-xr-xjet_tools/JetCreator/img_Copy.py51
-rwxr-xr-xjet_tools/JetCreator/img_Cut.py104
-rwxr-xr-xjet_tools/JetCreator/img_Find.py85
-rwxr-xr-xjet_tools/JetCreator/img_New.py61
-rwxr-xr-xjet_tools/JetCreator/img_Open.py79
-rwxr-xr-xjet_tools/JetCreator/img_Paste.py41
-rwxr-xr-xjet_tools/JetCreator/img_Print.py62
-rwxr-xr-xjet_tools/JetCreator/img_Redo.py79
-rwxr-xr-xjet_tools/JetCreator/img_Save.py99
-rwxr-xr-xjet_tools/JetCreator/img_Undo.py81
-rwxr-xr-xjet_tools/JetCreator/img_favicon.py61
-rwxr-xr-xjet_tools/JetCreator/img_splash.py1157
-rwxr-xr-xjet_tools/JetCreator/midifile.py1579
29 files changed, 11335 insertions, 0 deletions
diff --git a/jet_tools/JetCreator/JetAudition.py b/jet_tools/JetCreator/JetAudition.py
new file mode 100755
index 0000000..bc0d4de
--- /dev/null
+++ b/jet_tools/JetCreator/JetAudition.py
@@ -0,0 +1,509 @@
+"""
+ File:
+ JetAudition.py
+
+ Contents and purpose:
+ Auditions a jet file to simulate interactive music functions
+
+ Copyright (c) 2008 Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+"""
+
+from __future__ import with_statement
+
+import wx
+import sys
+import thread
+import time
+
+from JetUtils import *
+from JetDefs import *
+from JetCtrls import JetListCtrl, JetTrackCtrl
+from JetSegGraph import SegmentGraph, Marker
+from eas import *
+from JetStatusEvent import *
+
+CMD_QUEUE_AND_CANCEL = 'QueueNCancel'
+CMD_QUEUE_AND_CANCEL_CURRENT = 'QueueCancelCurrent'
+CMD_MUTEALL = 'MuteAll'
+CMD_UNMUTEALL = 'UnMuteAll'
+CMD_ORIGINALMUTES = 'MuteOrg'
+CMD_STOP = 'Stop'
+CMD_PAUSE = 'Pause'
+CMD_PLAY = 'Play'
+
+STATUS_PENDING = 'Pending'
+STATUS_PLAYING = 'Playing'
+STATUS_COMPLETE = 'Complete'
+STATUS_CANCELED = 'Canceled'
+STATUS_QUEUED = 'Queued'
+
+LOAD_QUEUE_DISPLAY = 'LOAD_QUEUE'
+GRAPH_POSITION_UPDATE = 'GRAPH_POS'
+NEW_SEGMENT_DISPLAY = 'NEW SEG'
+CLR_INFO = 'CLR_INFO'
+
+class Audition(wx.Dialog):
+ """ Initializes Audition window controls, then spawns off a thread to be ready for playback commands """
+ def __init__(self, jet_file, pSize):
+ wx.Dialog.__init__(self, None, -1, title=JetDefs.DLG_AUDITION)
+
+ self.jet = None
+ self.playerLock = threading.RLock()
+ self.jet_file = jet_file
+ self.queueSegs = []
+ self.keepPlaying = True
+ self.nextSegNum = 0
+ self.currentSegmentIndex = None
+ self.currentSegmentName = ""
+ self.playCommand = ""
+ self.threadShutdown = True
+
+ panel = wx.Panel(self, -1)
+
+ self.segList = JetListCtrl(panel)
+ self.segList.AddCol(JetDefs.GRD_SEGMENTS, 180)
+ self.segList.AddCol(JetDefs.GRD_LENGTH, 20)
+
+ self.segList.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnQueueSegment)
+ self.segList.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnSegListClick)
+
+ self.queueList = JetListCtrl(panel)
+ self.queueList.AddCol(JetDefs.GRD_QUEUE, 180)
+ self.queueList.AddCol(JetDefs.GRD_STATUS, 20)
+
+ self.trackList = JetTrackCtrl(panel)
+ self.trackList.AddCol(JetDefs.GRD_TRACK, JetDefs.MUTEGRD_TRACK)
+ self.trackList.AddCol(JetDefs.GRD_CHANNEL, JetDefs.MUTEGRD_CHANNEL)
+ self.trackList.AddCol(JetDefs.GRD_NAME, JetDefs.MUTEGRD_NAME)
+ self.trackList.BindCheckBox(self.OnTrackChecked)
+
+ self.btnMuteAll = wx.Button(panel, -1, JetDefs.BUT_MUTEALL)
+ self.btnUnMuteAll = wx.Button(panel, -1, JetDefs.BUT_MUTENONE)
+ self.btnMuteOrg = wx.Button(panel, -1, JetDefs.BUT_ORGMUTES)
+ hMuteButs = wx.BoxSizer(wx.HORIZONTAL)
+ hMuteButs.Add(self.btnMuteAll, 1, wx.EXPAND)
+ hMuteButs.Add(self.btnUnMuteAll, 1, wx.EXPAND)
+ hMuteButs.Add(self.btnMuteOrg, 1, wx.EXPAND)
+ vMuteButs = wx.BoxSizer(wx.VERTICAL)
+ vMuteButs.Add(self.trackList, 1, wx.EXPAND)
+ vMuteButs.Add((-1, 5))
+ vMuteButs.Add(hMuteButs, 0, wx.EXPAND)
+
+ self.btnQueue = wx.Button(panel, -1, JetDefs.BUT_QUEUE)
+ self.btnCancelNQueue = wx.Button(panel, -1, JetDefs.BUT_CANCELANDQUEUE)
+ hSegButs = wx.BoxSizer(wx.HORIZONTAL)
+ hSegButs.Add(self.btnQueue, 1, wx.EXPAND)
+ hSegButs.Add(self.btnCancelNQueue, 1, wx.EXPAND)
+ vSegButs = wx.BoxSizer(wx.VERTICAL)
+ vSegButs.Add(self.segList, 1, wx.EXPAND)
+ vSegButs.Add((-1, 5))
+ vSegButs.Add(hSegButs, 0, wx.EXPAND)
+
+ self.btnQueueCancelCurrent = wx.Button(panel, -1, JetDefs.BUT_CANCELCURRENT)
+ self.btnPause = wx.Button(panel, -1, JetDefs.BUT_PAUSE)
+ self.btnStop = wx.Button(panel, -1, JetDefs.BUT_STOP)
+ hQueueButs = wx.BoxSizer(wx.HORIZONTAL)
+ hQueueButs.Add(self.btnQueueCancelCurrent, 1, wx.EXPAND)
+ hQueueButs.Add(self.btnPause, 1, wx.EXPAND)
+ hQueueButs.Add(self.btnStop, 1, wx.EXPAND)
+ vQueueButs = wx.BoxSizer(wx.VERTICAL)
+ vQueueButs.Add(self.queueList, 1, wx.EXPAND)
+ vQueueButs.Add((-1, 5))
+ vQueueButs.Add(hQueueButs, 0, wx.EXPAND)
+
+ self.Bind(wx.EVT_BUTTON, self.OnQueueSegmentViaBut, id=self.btnQueue.GetId())
+ self.Bind(wx.EVT_BUTTON, self.OnCancelNQueue, id=self.btnCancelNQueue.GetId())
+ self.Bind(wx.EVT_BUTTON, self.OnStop, id=self.btnStop.GetId())
+ self.Bind(wx.EVT_BUTTON, self.OnQueueCancelCurrent, id=self.btnQueueCancelCurrent.GetId())
+ self.Bind(wx.EVT_BUTTON, self.OnPause, id=self.btnPause.GetId())
+ self.Bind(wx.EVT_BUTTON, self.OnMuteAll, id=self.btnMuteAll.GetId())
+ self.Bind(wx.EVT_BUTTON, self.OnUnMuteAll, id=self.btnUnMuteAll.GetId())
+ self.Bind(wx.EVT_BUTTON, self.OnMuteOrg, id=self.btnMuteOrg.GetId())
+
+ EVT_JET_STATUS(self, self.OnJetStatusUpdate)
+
+ BORDER = 10
+ hboxTop = wx.BoxSizer(wx.HORIZONTAL)
+ hboxTop.Add(vSegButs, 1, wx.EXPAND)
+ hboxTop.Add((5, -1))
+ hboxTop.Add(vQueueButs, 1, wx.EXPAND)
+ hboxTop.Add((5, -1))
+ hboxTop.Add(vMuteButs, 1, wx.EXPAND)
+
+ self.log = wx.TextCtrl(panel, -1)
+ self.graph = SegmentGraph(panel, size=(-1, 50))
+ self.graph.ClickCallbackFct = self.GraphTriggerClip
+
+ vboxBot = wx.BoxSizer(wx.VERTICAL)
+ vboxBot.Add(self.log, 0, wx.EXPAND)
+ vboxBot.Add((-1, 5))
+ vboxBot.Add(self.graph, 1, wx.EXPAND)
+
+ hboxMain = wx.BoxSizer(wx.VERTICAL)
+ hboxMain.Add(hboxTop, 2, wx.EXPAND | wx.ALL, BORDER)
+ hboxMain.Add(vboxBot, 1, wx.EXPAND | wx.ALL, BORDER)
+
+ panel.SetSizer(hboxMain)
+
+ self.LoadSegList()
+ self.initHelp()
+
+ self.SetSize(pSize)
+ self.CenterOnParent()
+
+ wx.EVT_CLOSE(self, self.OnClose)
+
+ thread.start_new_thread(self.PlaySegs, ())
+
+ def initHelp(self):
+ """ Initializes context sensitive help text """
+ self.SetExtraStyle(wx.DIALOG_EX_CONTEXTHELP )
+ self.SetHelpText(GetJetHelpText(JetDefs.AUDITION_CTRLS, ''))
+ self.segList.SetHelpText(GetJetHelpText(JetDefs.AUDITION_CTRLS, JetDefs.AUDITION_SEGLIST))
+ self.queueList.SetHelpText(GetJetHelpText(JetDefs.AUDITION_CTRLS, JetDefs.AUDITION_QUEUELIST))
+ self.trackList.SetHelpText(GetJetHelpText(JetDefs.AUDITION_CTRLS, JetDefs.AUDITION_TRACKLIST))
+ self.graph.SetHelpText(GetJetHelpText(JetDefs.AUDITION_CTRLS, JetDefs.AUDITION_GRAPH))
+
+ def OnMuteAll(self, event):
+ """ Sets command to mute all tracks """
+ self.SetPlayCommand(CMD_MUTEALL)
+
+ def OnUnMuteAll(self, event):
+ """ Sets command to un-mute all tracks """
+ self.SetPlayCommand(CMD_UNMUTEALL)
+
+ def OnMuteOrg(self, event):
+ """ Sets command to set mute flags to their original values """
+ self.SetPlayCommand(CMD_ORIGINALMUTES)
+
+ def OnTrackChecked(self, index, checked):
+ """ Mutes or un-mutes a track interactively """
+ with self.playerLock:
+ trackNum = self.trackList.GetTrackNumber(index)
+ self.SetMuteFlag(trackNum, checked)
+
+ def SetMuteFlag(self, trackNum, mute):
+ """ Mutes or un-mutes a track """
+ with self.playerLock:
+ try:
+ sync = JetDefs.DEFAULT_MUTE_SYNC
+ self.jet.SetMuteFlag(trackNum, mute, sync)
+ logging.info("SetMuteFlag() Track:%d Mute:%d Sync:%d" % (trackNum, mute, sync))
+ return True
+ except:
+ return False
+
+ def LoadSegList(self):
+ """ Loads the list of segments """
+ with self.playerLock:
+ self.segList.DeleteAllItems()
+ for segment in self.jet_file.GetSegments():
+ info = MidiSegInfo(segment)
+ index = self.segList.InsertStringItem(sys.maxint, StrNoneChk(segment.segname))
+ self.segList.SetStringItem(index, 1, TimeStr(info.iLengthInMs))
+
+ def GraphTriggerClip(self, sClipName, iEventId):
+ """ Triggers a clip """
+ with self.playerLock:
+ try:
+ self.jet.TriggerClip(iEventId)
+ self.log.SetValue(JetDefs.PLAY_TRIGGERCLIP_MSG % (iEventId, sClipName))
+ return True
+ except:
+ return False
+
+ def OnSegListClick(self, event):
+ """ Sets current segment name based on what's clicked """
+ with self.playerLock:
+ self.currentSegmentIndex = event.m_itemIndex
+ self.currentSegmentName = getColumnText(self.segList, event.m_itemIndex, 0)
+
+ def OnCancelNQueue(self, event):
+ """ Sets command to cancel the currently playing segment and queues another """
+ if self.currentSegmentIndex == None:
+ return
+ self.SetPlayCommand(CMD_QUEUE_AND_CANCEL)
+
+ def OnPause(self, event):
+ """ Sets a command to pause playback """
+ if self.currentSegmentIndex == None:
+ return
+ self.SetPlayCommand(CMD_PAUSE)
+
+ def OnStop(self, event):
+ """ Sets a command to stop playback """
+ if self.currentSegmentIndex == None:
+ return
+ self.SetPlayCommand(CMD_STOP)
+
+ def OnQueueCancelCurrent(self, event):
+ """ Sets a command to cancel the currently playing segment """
+ if self.currentSegmentIndex == None:
+ return
+ self.SetPlayCommand(CMD_QUEUE_AND_CANCEL_CURRENT)
+
+ def OnQueueSegmentViaBut(self, event):
+ """ Queues a segment via the button """
+ if self.currentSegmentIndex == None:
+ return
+ with self.playerLock:
+ segNum = self.currentSegmentIndex
+ segment = self.jet_file.GetSegment(self.currentSegmentName)
+ self.QueueOneSegment(segment, segNum)
+
+ def OnQueueSegment(self, event):
+ """ Queues a segment """
+ with self.playerLock:
+ segNum = event.m_itemIndex
+ segment = self.jet_file.GetSegment(getColumnText(self.segList, segNum, 0))
+ self.QueueOneSegment(segment, segNum)
+
+ def QueueOneSegment(self, segment, segNum):
+ """ Queues one segment """
+ with self.playerLock:
+ userID = len(self.queueSegs)
+ if FileExists(segment.dlsfile):
+ dls_num = FindDlsNum(self.jet_file.libraries, segment.dlsfile)
+ else:
+ dls_num = -1
+ self.queueSegs.append(QueueSeg(segment.segname, userID, segNum, dls_num, segment.repeat, segment.transpose, segment.mute_flags, STATUS_PENDING))
+ self.LoadQueueDisplay()
+
+ def SetKeepPlayingFlag(self, val):
+ """ Sets a flag to continue play loop or shut down """
+ with self.playerLock:
+ self.keepPlaying = val
+
+ def GetKeepPlayingFlag(self):
+ """ Gets the play flag """
+ with self.playerLock:
+ return self.keepPlaying
+
+ def SetThreadShutdownFlag(self, val):
+ """ Set a flag to shutdown thread """
+ with self.playerLock:
+ self.threadShutdown = val
+
+ def GetThreadShutdownFlag(self):
+ """ Gets the thread shutdown flag """
+ with self.playerLock:
+ return self.threadShutdown
+
+ def SetPlayCommand(self, cmd):
+ """ Sets a play command """
+ with self.playerLock:
+ self.playCommand = cmd
+
+ def GetPlayCommand(self):
+ """ Gets a play command """
+ with self.playerLock:
+ return self.playCommand
+
+ def SetStatus(self, index, status):
+ """ Sets the status of a segment """
+ with self.playerLock:
+ self.queueSegs[index].status = status
+
+ def GetStatus(self, index):
+ """ Gets the status of a segment """
+ with self.playerLock:
+ return self.queueSegs[index].status
+
+ def LoadQueueDisplay(self):
+ """ Loads up the displayed queue list """
+ with self.playerLock:
+ self.queueList.DeleteAllItems()
+ for item in self.queueSegs:
+ index = self.queueList.InsertStringItem(sys.maxint, item.name)
+ self.queueList.SetStringItem(index, 1, item.status)
+
+ def NextSegment(self):
+ """ Gets the next segment in the queueu """
+ with self.playerLock:
+ num = len(self.queueSegs)
+ for i in range(num):
+ if self.queueSegs[i].status == STATUS_PENDING:
+ return i
+ return -1
+
+ def PlaySegs(self):
+ """ Sets up a loop looking for jet file actions based on UI commands """
+ self.jet = JET()
+ self.jet.eas.StartWave()
+ self.jet.OpenFile(self.jet_file.config.filename)
+
+ self.SetKeepPlayingFlag(True)
+ while self.GetKeepPlayingFlag():
+ self.SetThreadShutdownFlag(False)
+
+ time.sleep(.5)
+ index = self.NextSegment()
+ if index != -1:
+ lastID = -1
+
+ Queue(self.jet, self.queueSegs[index])
+
+ self.SetStatus(index, STATUS_QUEUED)
+
+ wx.PostEvent(self, JetStatusEvent(LOAD_QUEUE_DISPLAY, None))
+
+ self.jet.Play()
+ self.paused = False
+ wx.PostEvent(self, JetStatusEvent(CMD_PLAY, None))
+
+ while self.GetKeepPlayingFlag():
+ self.jet.Render()
+ status = self.jet.Status()
+
+ if status.currentUserID <> lastID and status.currentUserID <> -1:
+ wx.PostEvent(self, JetStatusEvent(NEW_SEGMENT_DISPLAY, status.currentUserID))
+ if lastID != -1:
+ self.SetStatus(lastID, STATUS_COMPLETE)
+ self.SetStatus(status.currentUserID, STATUS_PLAYING)
+ lastID = status.currentUserID
+ wx.PostEvent(self, JetStatusEvent(LOAD_QUEUE_DISPLAY, None))
+
+ if status.numQueuedSegments == 0:
+ break
+
+ self.jet.GetAppEvent()
+
+ index = self.NextSegment()
+ if (index >= 0) and (status.numQueuedSegments < 2):
+ Queue(self.jet, self.queueSegs[index])
+ self.SetStatus(index, STATUS_QUEUED)
+ wx.PostEvent(self, JetStatusEvent(LOAD_QUEUE_DISPLAY, None))
+
+ wx.PostEvent(self, JetStatusEvent(GRAPH_POSITION_UPDATE, status.location))
+
+ playCmd = self.GetPlayCommand()
+ if playCmd == CMD_QUEUE_AND_CANCEL or playCmd == CMD_STOP or playCmd == CMD_QUEUE_AND_CANCEL_CURRENT:
+ if playCmd == CMD_QUEUE_AND_CANCEL or playCmd == CMD_STOP:
+ num = len(self.queueSegs)
+ for i in range(num):
+ curStatus = self.GetStatus(i)
+ if curStatus == STATUS_PENDING or curStatus == STATUS_PLAYING or curStatus == STATUS_QUEUED:
+ self.SetStatus(i, STATUS_CANCELED)
+
+ if playCmd == CMD_QUEUE_AND_CANCEL_CURRENT:
+ self.SetStatus(status.currentUserID, STATUS_CANCELED)
+ num = len(self.queueSegs)
+ for i in range(num):
+ curStatus = self.GetStatus(i)
+ if curStatus == STATUS_QUEUED:
+ self.SetStatus(i, STATUS_PENDING)
+
+ if playCmd == CMD_QUEUE_AND_CANCEL:
+ segNum = self.currentSegmentIndex
+ segment = self.jet_file.GetSegment(self.currentSegmentName)
+ wx.PostEvent(self, JetStatusEvent(CMD_QUEUE_AND_CANCEL, (segment, segNum)))
+
+ #MAC has a 'pop' when clearing the queue; not sure why so this avoids it
+ if OsWindows():
+ self.jet.Clear_Queue()
+ else:
+ self.jet = self.SafeJetRestart(self.playerLock, self.jet, self.jet_file.config.filename)
+
+ if playCmd == CMD_ORIGINALMUTES:
+ wx.PostEvent(self, JetStatusEvent(CMD_ORIGINALMUTES, segment.mute_flags))
+
+ if playCmd == CMD_UNMUTEALL:
+ wx.PostEvent(self, JetStatusEvent(CMD_UNMUTEALL, None))
+
+ if playCmd == CMD_PAUSE:
+ wx.PostEvent(self, JetStatusEvent(CMD_PAUSE, None))
+
+ if playCmd == CMD_MUTEALL:
+ wx.PostEvent(self, JetStatusEvent(CMD_MUTEALL, None))
+
+ self.SetPlayCommand('')
+
+ if self.GetStatus(lastID) != STATUS_CANCELED:
+ self.SetStatus(lastID, STATUS_COMPLETE)
+
+ wx.PostEvent(self, JetStatusEvent(LOAD_QUEUE_DISPLAY, None))
+ wx.PostEvent(self, JetStatusEvent(CLR_INFO, None))
+
+ SafeJetShutdown(self.playerLock, self.jet)
+ self.SetThreadShutdownFlag(True)
+
+ def OnJetStatusUpdate(self, evt):
+ """ All UI needed from within thread called via postevent otherwise mac crashes """
+ if evt.mode == LOAD_QUEUE_DISPLAY:
+ self.LoadQueueDisplay()
+ elif evt.mode == GRAPH_POSITION_UPDATE:
+ self.graph.UpdateLocation(evt.data)
+ elif evt.mode == NEW_SEGMENT_DISPLAY:
+ self.currentSegmentName = getColumnText(self.queueList, evt.data, 0)
+ segment = self.jet_file.GetSegment(self.currentSegmentName)
+ info = self.graph.LoadSegment(segment)
+ self.trackList.DeleteAllItems()
+ if info <> None:
+ for track in info.trackList:
+ self.trackList.AddTrackRow(track)
+ self.trackList.CheckTracks(segment.mute_flags)
+ self.log.SetValue(self.currentSegmentName)
+ elif evt.mode == CMD_QUEUE_AND_CANCEL:
+ self.QueueOneSegment(evt.data[0], evt.data[1])
+ elif evt.mode == CMD_ORIGINALMUTES:
+ self.trackList.CheckTracks(evt.data)
+ elif evt.mode == CMD_UNMUTEALL:
+ num = self.trackList.GetItemCount()
+ for i in range(num):
+ self.trackList.CheckItem(i, False)
+ elif evt.mode == CMD_MUTEALL:
+ num = self.trackList.GetItemCount()
+ for i in range(num):
+ self.trackList.CheckItem(i)
+ elif evt.mode == CLR_INFO:
+ self.log.SetValue("")
+ self.graph.ClearGraph()
+ self.graph.UpdateLocation(0)
+ elif evt.mode == CMD_PLAY:
+ self.btnPause.SetLabel(JetDefs.BUT_PAUSE)
+ elif evt.mode == CMD_PAUSE or evt.mode == CMD_PLAY:
+ if not self.paused:
+ self.jet.Pause()
+ self.paused = True
+ self.btnPause.SetLabel(JetDefs.BUT_RESUME)
+ else:
+ self.jet.Play()
+ self.paused = False
+ self.btnPause.SetLabel(JetDefs.BUT_PAUSE)
+
+ def SafeJetRestart(self, lock, jet, filename):
+ """ Shuts down the jet engine """
+ SafeJetShutdown(lock, jet)
+ with lock:
+ jet = JET()
+ jet.eas.StartWave()
+ jet.OpenFile(filename)
+ return jet
+
+ def OnClose(self, event):
+ """ When exiting the audition window, shut down jet play thread """
+ i = 0
+ while(not self.GetThreadShutdownFlag() and i < 5):
+ #Make sure we shutdown the playing thread, but don't wait forever
+ self.SetKeepPlayingFlag(False)
+ logging.info("Waiting on shutdown %d" % (self.GetThreadShutdownFlag()))
+ time.sleep(.5)
+ i = i + 1
+
+ #make certain we clean up
+ if self.jet is not None:
+ SafeJetShutdown(self.playerLock, self.jet)
+ self.Destroy()
+
diff --git a/jet_tools/JetCreator/JetCreator.py b/jet_tools/JetCreator/JetCreator.py
new file mode 100755
index 0000000..a6f9eb6
--- /dev/null
+++ b/jet_tools/JetCreator/JetCreator.py
@@ -0,0 +1,1431 @@
+"""
+ File:
+ JetCreator.py
+
+ Contents and purpose:
+ Jet file creation utility for JET sound engine
+
+ Copyright (c) 2008 Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+"""
+
+from __future__ import with_statement
+
+import wx
+import sys
+import thread
+import copy
+import wx.html
+import operator
+
+from wx.lib.mixins.listctrl import CheckListCtrlMixin, ListCtrlAutoWidthMixin
+from eas import *
+from JetFile import *
+from JetUtils import *
+from JetCtrls import *
+from JetDialogs import *
+from JetSegGraph import SegmentGraph, Marker
+from JetAudition import *
+from JetStatusEvent import *
+
+import img_favicon
+import img_New
+
+provider = wx.SimpleHelpProvider()
+wx.HelpProvider_Set(provider)
+
+
+class JetCreator(wx.Frame):
+ """ Main window of JetCreator utility """
+ def __init__(self, parent, id, jetConfigFile, importFlag=False):
+ wx.Frame.__init__(self, parent, id, size=(1050, 720), style=wx.DEFAULT_FRAME_STYLE | wx.MINIMIZE_BOX | wx.MAXIMIZE_BOX)
+
+ self.myicon = img_favicon.getIcon()
+ self.SetIcon(self.myicon)
+ self.UndoStack = []
+ self.RedoStack = []
+ self.queueSegs = []
+ self.clipBoard = None
+ self.jet = None
+ self.playerLock = threading.RLock()
+ self.SetKeepPlayingFlag(True)
+ self.currentSegmentName = None
+ self.currentSegmentIndex = None
+ self.currentEventName = None
+ self.currentEventIndex = None
+ self.currentCtrl = ""
+ self.currentJetConfigFile = jetConfigFile
+ self.paused = False
+ self.eventlistSort = (0, 1)
+ self.seglistSort = (0, 1)
+ if self.currentJetConfigFile == "":
+ FileKillClean(JetDefs.UNTITLED_FILE)
+ self.currentJetConfigFile = JetDefs.UNTITLED_FILE
+
+ self.jet_file = JetFile(self.currentJetConfigFile, "")
+
+ if not ValidateConfig(self.jet_file):
+ FileKillClean(JetDefs.UNTITLED_FILE)
+ self.currentJetConfigFile = JetDefs.UNTITLED_FILE
+ self.jet_file = JetFile(self.currentJetConfigFile, "")
+
+ if self.currentJetConfigFile == JetDefs.UNTITLED_FILE:
+ self.LoadDefaultProperties()
+
+ self.initLayout()
+ self.initStatusBar()
+ self.createMenuBar()
+ self.createToolbar()
+ self.SetCurrentFile(self.currentJetConfigFile)
+ self.initHelp()
+
+ self.graph.ClickCallbackFct = self.GraphTriggerClip
+
+ EVT_JET_STATUS(self, self.OnJetStatusUpdate)
+
+ wx.EVT_CLOSE(self, self.OnClose)
+
+ self.Centre()
+ self.Show(True)
+
+ if importFlag:
+ self.OnJetImportArchive(None)
+
+ self.eventList.OnSortOrderChangedAlert = self.OnEventSortOrderChanged
+ self.segList.OnSortOrderChangedAlert = self.OnSegSortOrderChanged
+
+ def initLayout(self):
+ """ Initializes the screen layout """
+ panel = wx.Panel(self, -1)
+
+ hboxMain = wx.BoxSizer(wx.HORIZONTAL)
+
+ leftPanel = wx.Panel(panel, -1)
+ leftTopPanel = wx.Panel(leftPanel, -1)
+ leftBotPanel = wx.Panel(leftPanel, -1)
+ rightPanel = wx.Panel(panel, -1)
+
+ self.segList = JetCheckListCtrl(rightPanel)
+ for title, width, fld in JetDefs.SEGMENT_GRID:
+ self.segList.AddCol(title, width)
+
+ self.eventList = JetListCtrl(rightPanel)
+ for title, width, fld in JetDefs.CLIPS_GRID:
+ self.eventList.AddCol(title, width)
+
+ self.eventList.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnEventListClick)
+ self.segList.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnSegListClick)
+ self.segList.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnSegmentUpdate)
+ self.eventList.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnEventUpdate)
+
+ self.segList.BindCheckBox(self.OnSegmentChecked)
+
+ BUT_SIZE = (95, 25)
+ self.btnAddSeg = wx.Button(leftTopPanel, -1, JetDefs.BUT_ADD, size=BUT_SIZE)
+ self.btnRevSeg = wx.Button(leftTopPanel, -1, JetDefs.BUT_REVISE, size=BUT_SIZE)
+ self.btnDelSeg = wx.Button(leftTopPanel, -1, JetDefs.BUT_DELETE, size=BUT_SIZE)
+ self.btnMoveSeg = wx.Button(leftTopPanel, -1, JetDefs.BUT_MOVE, size=BUT_SIZE)
+
+ self.btnQueueAll = wx.Button(leftTopPanel, -1, JetDefs.BUT_QUEUEALL, size=BUT_SIZE)
+ self.btnDequeueAll = wx.Button(leftTopPanel, -1, JetDefs.BUT_DEQUEUEALL, size=BUT_SIZE)
+ self.btnPlay = wx.Button(leftTopPanel, -1, JetDefs.BUT_PLAY, size=BUT_SIZE)
+ self.btnPause = wx.Button(leftTopPanel, -1, JetDefs.BUT_PAUSE, size=BUT_SIZE)
+ self.btnAudition = wx.Button(leftTopPanel, -1, JetDefs.BUT_AUDITION, size=BUT_SIZE)
+
+ self.btnAddEvt = wx.Button(leftBotPanel, -1, JetDefs.BUT_ADD, size=BUT_SIZE)
+ self.btnRevEvt = wx.Button(leftBotPanel, -1, JetDefs.BUT_REVISE, size=BUT_SIZE)
+ self.btnDelEvt = wx.Button(leftBotPanel, -1, JetDefs.BUT_DELETE, size=BUT_SIZE)
+ self.btnMoveEvents = wx.Button(leftBotPanel, -1, JetDefs.BUT_MOVE, size=BUT_SIZE)
+
+ self.Bind(wx.EVT_BUTTON, self.OnSegmentAdd, id=self.btnAddSeg.GetId())
+ self.Bind(wx.EVT_BUTTON, self.OnSegmentUpdate, id=self.btnRevSeg.GetId())
+ self.Bind(wx.EVT_BUTTON, self.OnSegmentDelete, id=self.btnDelSeg.GetId())
+ self.Bind(wx.EVT_BUTTON, self.OnSegmentsMove, id=self.btnMoveSeg.GetId())
+
+ self.Bind(wx.EVT_BUTTON, self.OnSelectAll, id=self.btnQueueAll.GetId())
+ self.Bind(wx.EVT_BUTTON, self.OnDeselectAll, id=self.btnDequeueAll.GetId())
+ self.Bind(wx.EVT_BUTTON, self.OnPlay, id=self.btnPlay.GetId())
+ self.Bind(wx.EVT_BUTTON, self.OnPause, id=self.btnPause.GetId())
+ self.Bind(wx.EVT_BUTTON, self.OnAudition, id=self.btnAudition.GetId())
+
+ self.Bind(wx.EVT_BUTTON, self.OnEventAdd, id=self.btnAddEvt.GetId())
+ self.Bind(wx.EVT_BUTTON, self.OnEventUpdate, id=self.btnRevEvt.GetId())
+ self.Bind(wx.EVT_BUTTON, self.OnEventDelete, id=self.btnDelEvt.GetId())
+ self.Bind(wx.EVT_BUTTON, self.OnEventsMove, id=self.btnMoveEvents.GetId())
+
+ BORDER = 5
+ BUT_SPACE = 3
+ vBoxLeftTop = wx.BoxSizer(wx.VERTICAL)
+ vBoxLeftBot = wx.BoxSizer(wx.VERTICAL)
+
+ vBoxLeftTop.Add(self.btnAddSeg, 0, wx.TOP, BORDER)
+ vBoxLeftTop.Add(self.btnRevSeg, 0, wx.TOP, BUT_SPACE)
+ vBoxLeftTop.Add(self.btnDelSeg, 0, wx.TOP, BUT_SPACE)
+ vBoxLeftTop.Add(self.btnMoveSeg, 0, wx.TOP, BUT_SPACE)
+ vBoxLeftTop.Add((-1, 12))
+ vBoxLeftTop.Add(self.btnQueueAll, 0, wx.TOP, BUT_SPACE)
+ vBoxLeftTop.Add(self.btnDequeueAll, 0, wx.TOP, BUT_SPACE)
+ vBoxLeftTop.Add(self.btnPlay, 0, wx.TOP, BUT_SPACE)
+ vBoxLeftTop.Add(self.btnPause, 0, wx.TOP, BUT_SPACE)
+ vBoxLeftTop.Add(self.btnAudition, 0, wx.TOP, BUT_SPACE)
+
+ vBoxLeftBot.Add(self.btnAddEvt, 0)
+ vBoxLeftBot.Add(self.btnRevEvt, 0, wx.TOP, BUT_SPACE)
+ vBoxLeftBot.Add(self.btnDelEvt, 0, wx.TOP, BUT_SPACE)
+ vBoxLeftBot.Add(self.btnMoveEvents, 0, wx.TOP, BUT_SPACE)
+
+ leftTopPanel.SetSizer(vBoxLeftTop)
+ leftBotPanel.SetSizer(vBoxLeftBot)
+
+ vboxLeft = wx.BoxSizer(wx.VERTICAL)
+ vboxLeft.Add(leftTopPanel, 1, wx.EXPAND)
+ vboxLeft.Add(leftBotPanel, 1, wx.EXPAND)
+ vboxLeft.Add((-1, 25))
+
+ leftPanel.SetSizer(vboxLeft)
+
+ self.log = wx.TextCtrl(rightPanel, -1)
+ self.graph = SegmentGraph(rightPanel, size=(-1, 50))
+
+ vboxRight = wx.BoxSizer(wx.VERTICAL)
+ vboxRight.Add(self.segList, 4, wx.EXPAND | wx.TOP, BORDER)
+ vboxRight.Add((-1, 10))
+ vboxRight.Add(self.eventList, 3, wx.EXPAND | wx.TOP, BORDER)
+ vboxRight.Add((-1, 10))
+ vboxRight.Add(self.log, 0, wx.EXPAND)
+ vboxRight.Add((-1, 5))
+ vboxRight.Add(self.graph, 1, wx.EXPAND)
+ vboxRight.Add((-1, 10))
+
+ rightPanel.SetSizer(vboxRight)
+
+ hboxMain.Add(leftPanel, 0, wx.EXPAND | wx.RIGHT | wx.LEFT, BORDER)
+ hboxMain.Add(rightPanel, 1, wx.EXPAND)
+ hboxMain.Add((BORDER, -1))
+
+ panel.SetSizer(hboxMain)
+
+ pnlGraph = wx.Panel(leftBotPanel, -1)
+ graphSizer1 = wx.BoxSizer(wx.VERTICAL)
+ pnlGraph.SetSizer(graphSizer1)
+
+ graphBox = wx.StaticBox(pnlGraph, wx.ID_ANY, label='Graph')
+ graphSizer2 = wx.StaticBoxSizer(graphBox, wx.VERTICAL)
+
+ self.chkGraphLabels = wx.CheckBox(pnlGraph, -1, JetDefs.GRAPH_LBLS)
+ self.chkGraphClips = wx.CheckBox(pnlGraph, -1, JetDefs.GRAPH_TRIGGER)
+ self.chkGraphAppEvts = wx.CheckBox(pnlGraph, -1, JetDefs.GRAPH_APP)
+
+ graphSizer2.Add(self.chkGraphLabels, 0, wx.TOP, BUT_SPACE)
+ graphSizer2.Add(self.chkGraphClips, 0, wx.TOP, BUT_SPACE)
+ graphSizer2.Add(self.chkGraphAppEvts, 0, wx.TOP | wx.BOTTOM, BUT_SPACE)
+ graphSizer1.Add((-1, 10))
+ graphSizer1.Add(graphSizer2)
+
+ vBoxLeftBot.Add(pnlGraph, 0, wx.TOP, BUT_SPACE)
+
+ self.Bind(wx.EVT_CHECKBOX, self.OnSetGraphOptions, id=self.chkGraphLabels.GetId())
+ self.Bind(wx.EVT_CHECKBOX, self.OnSetGraphOptions, id=self.chkGraphClips.GetId())
+ self.Bind(wx.EVT_CHECKBOX, self.OnSetGraphOptions, id=self.chkGraphAppEvts.GetId())
+
+
+ def initHelp(self):
+ """ Initializes the help text for screen elements """
+ self.SetHelpText(GetJetHelpText(JetDefs.MAIN_DLG_CTRLS, ''))
+ self.segList.SetHelpText(GetJetHelpText(JetDefs.MAIN_DLG_CTRLS, JetDefs.MAIN_SEGLIST))
+ self.eventList.SetHelpText(GetJetHelpText(JetDefs.MAIN_DLG_CTRLS, JetDefs.MAIN_EVENTLIST))
+ self.graph.SetHelpText(GetJetHelpText(JetDefs.AUDITION_CTRLS, JetDefs.AUDITION_GRAPH))
+
+ def initStatusBar(self):
+ """ Initializes the status bar """
+ self.statusbar = self.CreateStatusBar()
+
+ def OnSelectAll(self, event):
+ """ Called from select all button """
+ num = self.segList.GetItemCount()
+ for i in range(num-1, -1, -1):
+ self.segList.CheckItem(i)
+
+ def OnDeselectAll(self, event):
+ """ Called from deselect all button """
+ num = self.segList.GetItemCount()
+ for i in range(num-1, -1, -1):
+ self.segList.CheckItem(i, False)
+
+ def LoadSegList(self):
+ """ Loads up the list of segments """
+ self.seglistSort = (IniGetValue(self.currentJetConfigFile, JetDefs.INI_SEGSORT, JetDefs.INI_SEGSORT_0, 'int', 0), IniGetValue(self.currentJetConfigFile, JetDefs.INI_SEGSORT, JetDefs.INI_SEGSORT_1, 'int', 1))
+ segments = self.jet_file.GetSegments()
+ if self.seglistSort[0] == 0:
+ self.SegSort(segments, "segname")
+ elif self.seglistSort[0] == 1:
+ self.SegSort(segments, "filename")
+ elif self.seglistSort[0] == 2:
+ self.SegSort(segments, "dlsfile")
+ elif self.seglistSort[0] == 3:
+ self.SegSort(segments, "start")
+ elif self.seglistSort[0] == 4:
+ self.SegSort(segments, "end")
+ elif self.seglistSort[0] == 5:
+ self.SegSort(segments, "quantize")
+ elif self.seglistSort[0] == 6:
+ self.SegSort(segments, "transpose")
+ elif self.seglistSort[0] == 7:
+ self.SegSort(segments, "repeat")
+ elif self.seglistSort[0] == 8:
+ self.SegSort(segments, "mute_flags")
+ listDataMap = []
+ self.currentSegmentIndex = None
+ self.currentSegmentName = None
+ self.segList.DeleteAllItems()
+ self.eventList.DeleteAllItems()
+ self.menuItems[JetDefs.MNU_UPDATE_SEG].Enable(False)
+ self.menuItems[JetDefs.MNU_DELETE_SEG].Enable(False)
+ self.menuItems[JetDefs.MNU_MOVE_SEG].Enable(False)
+
+ self.menuItems[JetDefs.MNU_ADD_EVENT].Enable(False)
+ self.menuItems[JetDefs.MNU_MOVE_EVENT].Enable(False)
+ self.menuItems[JetDefs.MNU_UPDATE_EVENT].Enable(False)
+ self.menuItems[JetDefs.MNU_DELETE_EVENT].Enable(False)
+ self.menuItems[JetDefs.MNU_MOVE_EVENT].Enable(False)
+ for segment in self.jet_file.GetSegments():
+ index = self.segList.InsertStringItem(sys.maxint, StrNoneChk(segment.segname))
+ self.segList.SetStringItem(index, 1, FileJustName(StrNoneChk(segment.filename)))
+ self.segList.SetStringItem(index, 2, FileJustName(StrNoneChk(segment.dlsfile)))
+ self.segList.SetStringItem(index, 3, mbtFct(segment.start, 1))
+ self.segList.SetStringItem(index, 4, mbtFct(segment.end, 1))
+ self.segList.SetStringItem(index, 5, StrNoneChk(segment.quantize))
+ self.segList.SetStringItem(index, 6, StrNoneChk(segment.transpose))
+ self.segList.SetStringItem(index, 7, StrNoneChk(segment.repeat))
+ self.segList.SetStringItem(index, 8, StrNoneChk(segment.mute_flags))
+
+ self.segList.SetItemData(index, index)
+ listDataMap.append((getColumnText(self.segList, index, 0).upper(), getColumnText(self.segList, index, 1).upper(), getColumnText(self.segList, index, 2).upper(), MbtVal(getColumnText(self.segList, index, 3)), MbtVal(getColumnText(self.segList, index, 4)), int(getColumnText(self.segList, index, 5)), int(getColumnText(self.segList, index, 6)), int(getColumnText(self.segList, index, 7)), int(getColumnText(self.segList, index, 8))))
+
+ self.segList.itemDataMap = listDataMap
+ self.segList.InitSorting(9)
+ self.graph.ClearGraph()
+
+ def LoadEventsForSeg(self, segName):
+ """ Loads up the events associated with a segment """
+ self.currentEventIndex = None
+ self.eventList.DeleteAllItems()
+ self.menuItems[JetDefs.MNU_UPDATE_EVENT].Enable(False)
+ self.menuItems[JetDefs.MNU_DELETE_EVENT].Enable(False)
+ self.menuItems[JetDefs.MNU_MOVE_EVENT].Enable(False)
+ self.eventlistSort = (IniGetValue(self.currentJetConfigFile, JetDefs.INI_EVENTSORT, JetDefs.INI_EVENTSORT_0, 'int', 0), IniGetValue(self.currentJetConfigFile, JetDefs.INI_EVENTSORT, JetDefs.INI_EVENTSORT_1, 'int', 1))
+ segment = self.jet_file.GetSegment(self.currentSegmentName)
+ if segment is not None:
+ if self.eventlistSort[0] == 0:
+ self.EventSort(segment.jetevents, "event_name")
+ elif self.eventlistSort[0] == 1:
+ self.EventSort(segment.jetevents, "event_type")
+ elif self.eventlistSort[0] == 2:
+ self.EventSort(segment.jetevents, "event_start")
+ elif self.eventlistSort[0] == 3:
+ self.EventSort(segment.jetevents, "event_end")
+ elif self.eventlistSort[0] == 4:
+ self.EventSort(segment.jetevents, "track_num")
+ elif self.eventlistSort[0] == 5:
+ self.EventSort(segment.jetevents, "channel_num")
+ elif self.eventlistSort[0] == 6:
+ self.EventSort(segment.jetevents, "event_id")
+ listDataMap = []
+ for jet_event in self.jet_file.GetEvents(segName):
+ index = self.eventList.InsertStringItem(sys.maxint, StrNoneChk(jet_event.event_name))
+ self.eventList.SetStringItem(index, 1, StrNoneChk(jet_event.event_type))
+ self.eventList.SetStringItem(index, 2, mbtFct(jet_event.event_start, 1))
+ self.eventList.SetStringItem(index, 3, mbtFct(jet_event.event_end, 1))
+ self.eventList.SetStringItem(index, 4, StrNoneChk(jet_event.track_num))
+ self.eventList.SetStringItem(index, 5, StrNoneChk(jet_event.channel_num + 1))
+ self.eventList.SetStringItem(index, 6, StrNoneChk(jet_event.event_id))
+
+ self.eventList.SetItemData(index, index)
+ listDataMap.append((getColumnText(self.eventList, index, 0).upper(), getColumnText(self.eventList, index, 1).upper(), MbtVal(getColumnText(self.eventList, index, 2)), MbtVal(getColumnText(self.eventList, index, 3)), int(getColumnText(self.eventList, index, 4)), int(getColumnText(self.eventList, index, 5)), int(getColumnText(self.eventList, index, 6))))
+
+ self.eventList.itemDataMap = listDataMap
+ self.eventList.InitSorting(7)
+
+ def OnEventListClick(self, event):
+ """ Sets the current event variable when selecting from the list """
+ self.currentCtrl = "eventList"
+ self.currentEventIndex = event.m_itemIndex
+ self.currentEventName = getColumnText(self.eventList, event.m_itemIndex, 0)
+ self.menuItems[JetDefs.MNU_UPDATE_EVENT].Enable(True)
+ self.menuItems[JetDefs.MNU_DELETE_EVENT].Enable(True)
+ self.menuItems[JetDefs.MNU_MOVE_EVENT].Enable(True)
+
+ def OnSegmentChecked(self, index, checked):
+ """ Selects the segment when checkbox clicked """
+ ClearRowSelections(self.segList)
+ SetRowSelection(self.segList, index, True)
+
+ def SelectSegment(self, segName):
+ """ Selects a segment by segment name """
+ itm = self.segList.FindItem(-1, segName)
+ self.segList.EnsureVisible(itm)
+ ClearRowSelections(self.segList)
+ SetRowSelection(self.segList, itm, True)
+
+ def SelectEvent(self, eventName):
+ """ Selects an event by event name """
+ itm = self.eventList.FindItem(-1, eventName)
+ self.eventList.EnsureVisible(itm)
+ ClearRowSelections(self.eventList)
+ SetRowSelection(self.eventList, itm, True)
+
+ def OnSegListClick(self, event):
+ """ Loads up a segment when the list is clicked """
+ self.currentCtrl = "segList"
+ self.currentSegmentIndex = event.m_itemIndex
+ self.currentSegmentName = getColumnText(self.segList, event.m_itemIndex, 0)
+ self.LoadEventsForSeg(getColumnText(self.segList, event.m_itemIndex, 0))
+ self.menuItems[JetDefs.MNU_UPDATE_SEG].Enable(True)
+ self.menuItems[JetDefs.MNU_DELETE_SEG].Enable(True)
+ self.menuItems[JetDefs.MNU_MOVE_SEG].Enable(True)
+ self.menuItems[JetDefs.MNU_ADD_EVENT].Enable(True)
+ info = self.graph.LoadSegment(self.jet_file.GetSegment(self.currentSegmentName), showLabels=IniGetValue(self.currentJetConfigFile, JetDefs.F_GRAPHLABELS, JetDefs.F_GRAPHLABELS, 'bool', 'True'), showClips=IniGetValue(self.currentJetConfigFile, JetDefs.F_GRAPHCLIPS, JetDefs.F_GRAPHCLIPS, 'bool', 'True'), showAppEvts=IniGetValue(self.currentJetConfigFile, JetDefs.F_GRAPHAPPEVTS, JetDefs.F_GRAPHAPPEVTS, 'bool', 'True'))
+ if info == None:
+ self.log.SetValue("")
+ else:
+ iLength = info.iLengthInMs
+ if iLength > 0:
+ self.log.SetValue("%s %.2f Seconds" % (self.currentSegmentName, iLength / 1000.00))
+ else:
+ self.log.SetValue("%s" % (self.currentSegmentName))
+
+ def OnSegmentAdd(self, event):
+ """ Calls the dialog box for adding a segment """
+ saveState = JetState(self.jet_file, self.currentSegmentIndex, self.currentEventIndex)
+
+ dlg = SegEdit(JetDefs.MAIN_ADDSEGTITLE, self.currentJetConfigFile)
+
+ for filename in self.jet_file.GetMidiFiles():
+ dlg.je.ctrls[JetDefs.F_MIDIFILE].Append(filename)
+ for library in self.jet_file.GetLibraries():
+ dlg.je.ctrls[JetDefs.F_DLSFILE].Append(library)
+
+ result = dlg.ShowModal()
+ if result == wx.ID_OK:
+ if len(dlg.lstReplicate) > 0:
+ if dlg.chkReplaceMatching:
+ self.jet_file.DeleteSegmentsMatchingPrefix(dlg.replicatePrefix)
+
+ for replicate in dlg.lstReplicate:
+ self.jet_file.AddSegment(replicate[0], dlg.GetValue(JetDefs.F_MIDIFILE),
+ mbtFct(replicate[1],-1), mbtFct(replicate[2],-1),
+ JetDefs.MBT_ZEROSTR,
+ SegmentOutputFile(dlg.GetValue(JetDefs.F_SEGNAME), self.currentJetConfigFile),
+ dlg.GetValue(JetDefs.F_QUANTIZE),
+ [], dlg.GetValue(JetDefs.F_DLSFILE),
+ None,
+ dlg.GetValue(JetDefs.F_TRANSPOSE),
+ dlg.GetValue(JetDefs.F_REPEAT),
+ dlg.GetValue(JetDefs.F_MUTEFLAGS))
+
+ self.LoadSegList()
+ self.SelectSegment(dlg.lstReplicate[0][0])
+ else:
+ self.jet_file.AddSegment(dlg.GetValue(JetDefs.F_SEGNAME), dlg.GetValue(JetDefs.F_MIDIFILE),
+ dlg.GetValue(JetDefs.F_START), dlg.GetValue(JetDefs.F_END),
+ JetDefs.MBT_ZEROSTR,
+ SegmentOutputFile(dlg.GetValue(JetDefs.F_SEGNAME), self.currentJetConfigFile),
+ dlg.GetValue(JetDefs.F_QUANTIZE),
+ [], dlg.GetValue(JetDefs.F_DLSFILE),
+ None,
+ dlg.GetValue(JetDefs.F_TRANSPOSE),
+ dlg.GetValue(JetDefs.F_REPEAT),
+ dlg.GetValue(JetDefs.F_MUTEFLAGS))
+ self.LoadSegList()
+ self.SelectSegment(dlg.GetValue(JetDefs.F_SEGNAME))
+ self.UndoAdd(saveState)
+ dlg.Destroy()
+
+ def OnSegmentUpdate(self, event):
+ """ Calls the dialog box for updating a segment """
+ if self.currentSegmentName is None:
+ return
+
+ segment = self.jet_file.GetSegment(self.currentSegmentName)
+ if segment == None:
+ return
+
+ saveState = JetState(self.jet_file, self.currentSegmentIndex, self.currentEventIndex)
+
+ dlg = SegEdit(JetDefs.MAIN_REVSEGTITLE, self.currentJetConfigFile)
+
+ for filename in self.jet_file.GetMidiFiles():
+ dlg.je.ctrls[JetDefs.F_MIDIFILE].Append(filename)
+ for library in self.jet_file.GetLibraries():
+ dlg.je.ctrls[JetDefs.F_DLSFILE].Append(library)
+
+ dlg.SetValue(JetDefs.F_SEGNAME, segment.segname)
+ dlg.SetValue(JetDefs.F_MUTEFLAGS, segment.mute_flags)
+ dlg.SetValue(JetDefs.F_MIDIFILE, segment.filename)
+ dlg.SetValue(JetDefs.F_DLSFILE, segment.dlsfile)
+ dlg.SetValue(JetDefs.F_START, segment.start)
+ dlg.SetValue(JetDefs.F_END, segment.end)
+ dlg.SetValue(JetDefs.F_QUANTIZE, segment.quantize)
+ dlg.SetValue(JetDefs.F_TRANSPOSE, segment.transpose)
+ dlg.SetValue(JetDefs.F_REPEAT, segment.repeat)
+ dlg.jetevents = segment.jetevents
+
+ result = dlg.ShowModal()
+ if result == wx.ID_OK:
+ self.jet_file.UpdateSegment(self.currentSegmentName, dlg.GetValue(JetDefs.F_SEGNAME),
+ dlg.GetValue(JetDefs.F_MIDIFILE),
+ dlg.GetValue(JetDefs.F_START), dlg.GetValue(JetDefs.F_END),
+ JetDefs.MBT_ZEROSTR, #dlg.GetValue(JetDefs.F_LENGTH),
+ SegmentOutputFile(dlg.GetValue(JetDefs.F_SEGNAME), self.currentJetConfigFile),
+ dlg.GetValue(JetDefs.F_QUANTIZE),
+ [], dlg.GetValue(JetDefs.F_DLSFILE),
+ None,
+ dlg.GetValue(JetDefs.F_TRANSPOSE),
+ dlg.GetValue(JetDefs.F_REPEAT),
+ dlg.GetValue(JetDefs.F_MUTEFLAGS))
+
+ if len(dlg.lstReplicate) > 0:
+ if dlg.chkReplaceMatching:
+ self.jet_file.DeleteSegmentsMatchingPrefix(dlg.replicatePrefix)
+
+ for replicate in dlg.lstReplicate:
+ self.jet_file.AddSegment(replicate[0], dlg.GetValue(JetDefs.F_MIDIFILE),
+ mbtFct(replicate[1],-1), mbtFct(replicate[2],-1),
+ JetDefs.MBT_ZEROSTR,
+ SegmentOutputFile(dlg.GetValue(JetDefs.F_SEGNAME), self.currentJetConfigFile),
+ dlg.GetValue(JetDefs.F_QUANTIZE),
+ [], dlg.GetValue(JetDefs.F_DLSFILE),
+ None,
+ dlg.GetValue(JetDefs.F_TRANSPOSE),
+ dlg.GetValue(JetDefs.F_REPEAT),
+ dlg.GetValue(JetDefs.F_MUTEFLAGS))
+
+ self.LoadSegList()
+ self.SelectSegment(dlg.lstReplicate[0][0])
+ else:
+ self.LoadSegList()
+ self.SelectSegment(dlg.GetValue(JetDefs.F_SEGNAME))
+ self.UndoAdd(saveState)
+ dlg.Destroy()
+
+ def OnSegmentDelete(self, event):
+ """ Confirms the deletion segment(s) by user action """
+ if self.currentSegmentName is None:
+ return
+
+ segment = self.jet_file.GetSegment(self.currentSegmentName)
+ if segment == None:
+ return
+
+ count = 0
+ deleteMsg = ''
+ item = self.segList.GetFirstSelected()
+ while item != -1:
+ if count == 0:
+ deleteMsg = getColumnText(self.segList,item,0)
+ else:
+ if count == 40:
+ deleteMsg = deleteMsg + "\n" + "....more"
+ elif count < 40:
+ deleteMsg = deleteMsg + "\n" + getColumnText(self.segList,item,0)
+ count = count + 1
+ item = self.segList.GetNextSelected(item)
+
+ if YesNo(JetDefs.MAIN_CONFIRM, deleteMsg + JetDefs.MAIN_CONFIRM_SEG_DLT, False):
+ item = self.segList.GetFirstSelected()
+ while item != -1:
+ segName = getColumnText(self.segList,item,0)
+ self.SegmentDelete(segName)
+ item = self.segList.GetNextSelected(item)
+
+ self.graph.ClearGraph()
+ self.LoadSegList()
+
+ def SegmentDelete(self, segName):
+ """ Deletes a segment """
+ saveState = JetState(self.jet_file, self.currentSegmentIndex, self.currentEventIndex)
+ self.jet_file.DeleteSegment(segName)
+ self.UndoAdd(saveState)
+
+ def OnSegmentsMove(self, event):
+ """ Move segment(s) """
+ if self.currentSegmentName is None:
+ return
+
+ lstMoveItems = []
+ count = 0
+ item = self.segList.GetFirstSelected()
+ while item != -1:
+ max = GetMidiInfo(self.jet_file.GetSegment(getColumnText(self.segList,item,0)).filename).endMbtStr
+ lstMoveItems.append((getColumnText(self.segList,item,0), mbtFct(getColumnText(self.segList,item,3),-1), mbtFct(getColumnText(self.segList,item,4),-1), max))
+ count = count + 1
+ item = self.segList.GetNextSelected(item)
+
+ if count == 0:
+ InfoMsg("Move", "Select one or more items to move.")
+ return
+
+ dlg = JetMove("Move Segments")
+ dlg.lstMoveItems = lstMoveItems
+ result = dlg.ShowModal()
+ if result == wx.ID_OK:
+ if len(dlg.lstMoveMbt) > 0:
+ saveState = JetState(self.jet_file, self.currentSegmentIndex, self.currentEventIndex)
+
+ for moveitem in dlg.lstMoveMbt:
+ self.jet_file.MoveSegment(moveitem[0], moveitem[1], moveitem[2])
+
+ self.LoadSegList()
+ self.UndoAdd(saveState)
+
+ dlg.Destroy()
+
+ def UndoAdd(self, saveState):
+ """ Adds the current state to the undo stack """
+ self.UndoStack.append(saveState)
+ self.menuItems[JetDefs.MNU_UNDO].Enable(True)
+
+ def RedoAdd(self, saveState):
+ """ Adds the current state the the redo stack """
+ self.RedoStack.append(saveState)
+ self.menuItems[JetDefs.MNU_REDO].Enable(True)
+
+ def OnRedo(self, event):
+ """ Redo if there's one in the stack """
+ if len(self.RedoStack) > 0:
+ self.UndoAdd(JetState(self.jet_file, self.currentSegmentIndex, self.currentEventIndex))
+ state = self.RedoStack.pop()
+ self.jet_file = copy.deepcopy(state.jet_file)
+ self.LoadSegList()
+ self.currentSegmentIndex = state.currentSegmentIndex
+ if self.currentSegmentIndex != None:
+ SetRowSelection(self.segList, self.currentSegmentIndex, True)
+ if len(self.RedoStack) == 0:
+ self.menuItems[JetDefs.MNU_REDO].Enable(False)
+
+ def OnUndo(self, event):
+ """ Undo if there's one in the stack """
+ if len(self.UndoStack) > 0:
+ self.RedoAdd(JetState(self.jet_file, self.currentSegmentIndex, self.currentEventIndex))
+ state = self.UndoStack.pop()
+ self.jet_file = copy.deepcopy(state.jet_file)
+ self.LoadSegList()
+ self.currentSegmentIndex = state.currentSegmentIndex
+ if self.currentSegmentIndex != None:
+ SetRowSelection(self.segList, self.currentSegmentIndex, True)
+ if len(self.UndoStack) == 0:
+ self.menuItems[JetDefs.MNU_UNDO].Enable(False)
+
+ def OnEventAdd(self, event):
+ """ Calls a dialog box to add an event to the current segment """
+ if self.currentSegmentName is None:
+ return
+
+ segment = self.jet_file.GetSegment(self.currentSegmentName)
+ if segment == None:
+ return
+
+ saveState = JetState(self.jet_file, self.currentSegmentIndex, self.currentEventIndex)
+
+ dlg = EventEdit(JetDefs.MAIN_ADDEVENTTITLE, self.currentJetConfigFile)
+ editSegment = copy.deepcopy(segment)
+ dlg.SetSegment(editSegment)
+ dlg.SetEventId()
+
+ result = dlg.ShowModal()
+ if result == wx.ID_OK:
+ if dlg.GetValue(JetDefs.F_ETYPE) == JetDefs.E_EOS:
+ #check for an existing EOS event
+ events = self.jet_file.GetEvents(self.currentSegmentName)
+ for evt in events:
+ if evt.event_type == JetDefs.E_EOS:
+ self.jet_file.DeleteEvent(self.currentSegmentName, evt.event_name)
+ dlg.SetValue(JetDefs.F_ESTART, dlg.GetValue(JetDefs.F_EEND))
+
+ if len(dlg.lstReplicate) > 0:
+ if dlg.chkReplaceMatching:
+ self.jet_file.DeleteEventsMatchingPrefix(self.currentSegmentName, dlg.replicatePrefix)
+
+ for replicate in dlg.lstReplicate:
+ self.jet_file.AddEvent(self.currentSegmentName, replicate[0],
+ dlg.GetValue(JetDefs.F_ETYPE),
+ dlg.GetValue(JetDefs.F_EEVENTID),
+ dlg.GetValue(JetDefs.F_ETRACK),
+ dlg.GetValue(JetDefs.F_ECHANNEL),
+ mbtFct(replicate[1],-1),
+ mbtFct(replicate[2],-1))
+ self.SelectSegment(self.currentSegmentName)
+ self.SelectEvent(dlg.lstReplicate[0][0])
+ else:
+ self.jet_file.AddEvent(self.currentSegmentName, dlg.GetValue(JetDefs.F_ENAME),
+ dlg.GetValue(JetDefs.F_ETYPE),
+ dlg.GetValue(JetDefs.F_EEVENTID),
+ dlg.GetValue(JetDefs.F_ETRACK),
+ dlg.GetValue(JetDefs.F_ECHANNEL),
+ dlg.GetValue(JetDefs.F_ESTART),
+ dlg.GetValue(JetDefs.F_EEND))
+
+ self.SelectSegment(self.currentSegmentName)
+ self.SelectEvent(dlg.GetValue(JetDefs.F_ENAME))
+
+ self.UndoAdd(saveState)
+ dlg.Destroy()
+
+ def OnEventUpdate(self, event):
+ """ Calls the dialog box to update the current event """
+ if self.currentSegmentName is None:
+ return
+
+ if self.currentEventName is None:
+ return
+
+ segment = self.jet_file.GetSegment(self.currentSegmentName)
+ if segment == None:
+ return
+
+ curEvent = copy.deepcopy(self.jet_file.GetEvent(self.currentSegmentName, self.currentEventName))
+ if curEvent == None:
+ return
+
+ saveState = JetState(self.jet_file, self.currentSegmentIndex, self.currentEventIndex)
+
+ #only want the event we are editing to show up in graph
+ editSegment = copy.deepcopy(segment)
+ editSegment.jetevents = []
+ editSegment.jetevents.append(curEvent)
+
+ dlg = EventEdit(JetDefs.MAIN_REVEVENTTITLE, self.currentJetConfigFile)
+ dlg.SetSegment(editSegment)
+ dlg.SetValue(JetDefs.F_ENAME, curEvent.event_name)
+ dlg.SetValue(JetDefs.F_ETYPE, curEvent.event_type)
+ dlg.SetValue(JetDefs.F_ESTART, curEvent.event_start)
+ dlg.SetValue(JetDefs.F_EEND, curEvent.event_end)
+ dlg.SetValue(JetDefs.F_ETRACK, curEvent.track_num)
+ dlg.SetValue(JetDefs.F_ECHANNEL, curEvent.channel_num)
+ dlg.SetValue(JetDefs.F_EEVENTID, curEvent.event_id)
+ dlg.OnEventSelect()
+
+ result = dlg.ShowModal()
+ if result == wx.ID_OK:
+ if dlg.GetValue(JetDefs.F_ETYPE) == JetDefs.E_EOS:
+ dlg.SetValue(JetDefs.F_ESTART, dlg.GetValue(JetDefs.F_EEND))
+
+ self.jet_file.UpdateEvent(self.currentSegmentName,
+ self.currentEventName,
+ dlg.GetValue(JetDefs.F_ENAME),
+ dlg.GetValue(JetDefs.F_ETYPE),
+ dlg.GetValue(JetDefs.F_EEVENTID),
+ dlg.GetValue(JetDefs.F_ETRACK),
+ dlg.GetValue(JetDefs.F_ECHANNEL),
+ dlg.GetValue(JetDefs.F_ESTART),
+ dlg.GetValue(JetDefs.F_EEND))
+
+ if len(dlg.lstReplicate) > 0:
+ if dlg.chkReplaceMatching:
+ self.jet_file.DeleteEventsMatchingPrefix(self.currentSegmentName, dlg.replicatePrefix)
+
+ for replicate in dlg.lstReplicate:
+ self.jet_file.AddEvent(self.currentSegmentName, replicate[0],
+ dlg.GetValue(JetDefs.F_ETYPE),
+ dlg.GetValue(JetDefs.F_EEVENTID),
+ dlg.GetValue(JetDefs.F_ETRACK),
+ dlg.GetValue(JetDefs.F_ECHANNEL),
+ mbtFct(replicate[1],-1),
+ mbtFct(replicate[2],-1))
+ self.SelectSegment(self.currentSegmentName)
+ self.SelectEvent(dlg.lstReplicate[0][0])
+ else:
+ self.SelectSegment(self.currentSegmentName)
+ self.SelectEvent(dlg.GetValue(JetDefs.F_ENAME))
+ self.UndoAdd(saveState)
+ dlg.Destroy()
+
+ def OnEventDelete(self, event):
+ """ Confirms the deletion of event(s) """
+ if self.currentSegmentName is None:
+ return
+
+ if self.currentEventName is None:
+ return
+
+ curEvent = self.jet_file.GetEvent(self.currentSegmentName, self.currentEventName)
+ if curEvent == None:
+ return
+
+ count = 0
+ deleteMsg = ''
+ item = self.eventList.GetFirstSelected()
+ while item != -1:
+ if count == 0:
+ deleteMsg = getColumnText(self.eventList,item,0)
+ else:
+ if count == 40:
+ deleteMsg = deleteMsg + "\n" + "....more"
+ elif count < 40:
+ deleteMsg = deleteMsg + "\n" + getColumnText(self.eventList,item,0)
+ count = count + 1
+ item = self.eventList.GetNextSelected(item)
+
+
+ if YesNo(JetDefs.MAIN_CONFIRM, deleteMsg + JetDefs.MAIN_CONRIRM_EVT_DLT, False):
+ item = self.eventList.GetFirstSelected()
+ while item != -1:
+ eventName = getColumnText(self.eventList,item,0)
+ self.EventDelete(eventName)
+ item = self.eventList.GetNextSelected(item)
+
+ self.SelectSegment(self.currentSegmentName)
+ self.LoadEventsForSeg(self.currentSegmentName)
+
+ def EventDelete(self, eventName):
+ """ Deletes an event """
+ saveState = JetState(self.jet_file, self.currentSegmentIndex, self.currentEventIndex)
+ self.jet_file.DeleteEvent(self.currentSegmentName, eventName)
+ self.UndoAdd(saveState)
+
+ def OnEventsMove(self, event):
+ """ Move event(s) """
+ if self.currentSegmentName is None:
+ return
+
+ if self.currentEventName is None:
+ return
+
+ segment = self.jet_file.GetSegment(self.currentSegmentName)
+ if segment == None:
+ return
+
+ curEvent = self.jet_file.GetEvent(self.currentSegmentName, self.currentEventName)
+ if curEvent == None:
+ return
+
+ lstMoveItems = []
+ count = 0
+ item = self.eventList.GetFirstSelected()
+ while item != -1:
+ lstMoveItems.append((getColumnText(self.eventList,item,0), mbtFct(getColumnText(self.eventList,item,2),-1), mbtFct(getColumnText(self.eventList,item,3),-1), segment.end))
+ count = count + 1
+ item = self.eventList.GetNextSelected(item)
+
+ if count == 0:
+ InfoMsg("Move", "Select one or more items to move.")
+ return
+
+ dlg = JetMove("Move Events")
+ dlg.lstMoveItems = lstMoveItems
+ result = dlg.ShowModal()
+ if result == wx.ID_OK:
+ if len(dlg.lstMoveMbt) > 0:
+ saveState = JetState(self.jet_file, self.currentSegmentIndex, self.currentEventIndex)
+
+ for moveitem in dlg.lstMoveMbt:
+ self.jet_file.MoveEvent(self.currentSegmentName, moveitem[0], moveitem[1], moveitem[2])
+
+ self.SelectSegment(self.currentSegmentName)
+ self.LoadEventsForSeg(self.currentSegmentName)
+
+ self.UndoAdd(saveState)
+
+ dlg.Destroy()
+
+ def OnJetOpen(self, event):
+ """ Calls a dialog box to get a jet config file to open """
+ dlg = JetOpen()
+ result = dlg.ShowModal()
+ if result == JetDefs.ID_JET_OPEN:
+ self.jet_file = JetFile(dlg.fileName , "")
+ if not ValidateConfig(self.jet_file):
+ FileKillClean(JetDefs.UNTITLED_FILE)
+ self.currentJetConfigFile = JetDefs.UNTITLED_FILE
+ self.jet_file = JetFile(self.currentJetConfigFile, "")
+ else:
+ self.SetCurrentFile(dlg.fileName)
+ elif result == JetDefs.ID_JET_NEW:
+ self.jet_file = JetFile("" , "")
+ self.SetCurrentFile(JetDefs.UNTITLED_FILE)
+ self.LoadDefaultProperties()
+ elif result == JetDefs.ID_JET_IMPORT:
+ self.OnJetImportArchive(event)
+ dlg.Destroy()
+
+ def OnJetSaveAs(self, event):
+ """ Calls a dialog box to allow saving the current jet file as another name """
+ defDir = IniGetValue(JetDefs.JETCREATOR_INI, JetDefs.INI_DEFAULTDIRS, JetDefs.JTC_FILE_SPEC, 'str', str(os.getcwd()))
+ dialog = wx.FileDialog(None, JetDefs.SAVE_PROMPT, defDir, "", JetDefs.JTC_FILE_SPEC, wx.SAVE | wx.OVERWRITE_PROMPT )
+ if dialog.ShowModal() == wx.ID_OK:
+ IniSetValue(JetDefs.JETCREATOR_INI, JetDefs.INI_DEFAULTDIRS, JetDefs.JTC_FILE_SPEC, str(FileJustPath(dialog.GetPath())))
+ self.currentJetConfigFile = FileJustRoot(dialog.GetPath()) + ".jtc"
+ self.jet_file.config.filename = FileJustRoot(self.currentJetConfigFile) + ".jet"
+ self.jet_file.SaveJetConfig(self.currentJetConfigFile)
+ self.jet_file.WriteJetFileFromConfig(self.currentJetConfigFile)
+ self.SetCurrentFile(self.currentJetConfigFile)
+ dialog.Destroy()
+
+ def OnJetSave(self, event):
+ """ Saves the current jet file to disk """
+ if self.currentJetConfigFile == JetDefs.UNTITLED_FILE:
+ self.OnJetSaveAs(event)
+ else:
+ self.jet_file.SaveJetConfig(self.currentJetConfigFile)
+ self.jet_file.WriteJetFileFromConfig(self.currentJetConfigFile)
+
+ def OnJetNew(self, event):
+ """ Initializes the state to a new jet file """
+ self.jet_file = JetFile("" , "")
+ self.SetCurrentFile(JetDefs.UNTITLED_FILE)
+ self.LoadDefaultProperties()
+
+ def SetCurrentFile(self, fileName):
+ """ Sets the state for the current jet file """
+ self.clipBoard = None
+ self.currentJetConfigFile = fileName
+ self.SetTitle(JetDefs.MAIN_TITLEPREFIX + FileJustName(fileName))
+ AppendRecentJetFile(fileName)
+ self.LoadSegList()
+ self.graph.ClearGraph()
+ self.chkGraphLabels.SetValue(IniGetValue(self.currentJetConfigFile, JetDefs.F_GRAPHLABELS, JetDefs.F_GRAPHLABELS, 'bool', 'True'))
+ self.chkGraphClips.SetValue(IniGetValue(self.currentJetConfigFile, JetDefs.F_GRAPHCLIPS, JetDefs.F_GRAPHCLIPS, 'bool', 'True'))
+ self.chkGraphAppEvts.SetValue(IniGetValue(self.currentJetConfigFile, JetDefs.F_GRAPHAPPEVTS, JetDefs.F_GRAPHAPPEVTS, 'bool', 'True'))
+
+ def createMenuBar(self):
+ """ Creates a menu bar """
+ self.menuItems = {}
+ menuBar = wx.MenuBar()
+ for eachMenuData in JetDefs.MENU_SPEC:
+ menuLabel = eachMenuData[0]
+ menuItems = eachMenuData[1:]
+ menuBar.Append(self.createMenu(menuItems), menuLabel)
+ self.SetMenuBar(menuBar)
+
+ def createMenu(self, menuData):
+ """ Creates a menu from the structure menuData in JetDefs """
+ menu = wx.Menu()
+ for eachLabel, eachStatus, eachHandler, eachEnable in menuData:
+ if not eachLabel:
+ menu.AppendSeparator()
+ continue
+ self.menuItems[eachLabel] = menu.Append(-1, eachLabel, eachStatus)
+ self.menuItems[eachLabel].Enable(eachEnable)
+ try:
+ self.Bind(wx.EVT_MENU, getattr(self, eachHandler) , self.menuItems[eachLabel])
+ except:
+ print("def " + eachHandler + "(self, event): pass")
+ return menu
+
+ def createToolbar(self):
+ """ Creates the toolbar """
+ toolbar = self.CreateToolBar()
+ toolbar.SetToolBitmapSize((32,32))
+ self.toolItems = {}
+ for eachTool in JetDefs.TOOLBAR_SPEC:
+ if eachTool[0] == '-':
+ toolbar.AddSeparator()
+ else:
+ b = __import__(eachTool[1])
+ bitMap = b.getBitmap()
+ self.toolItems[eachTool[0]] = toolbar.AddLabelTool(-1, label=eachTool[0],
+ bitmap=bitMap,
+ shortHelp=eachTool[0], longHelp=eachTool[2])
+ self.Bind(wx.EVT_TOOL, getattr(self, eachTool[3]) , self.toolItems[eachTool[0]])
+ toolbar.Realize()
+
+ def OnAudition(self, event):
+ """ Calls the audition window for simple preview of jet file """
+ jet_file = CreateTempJetFile(self.jet_file)
+
+ w, h = self.GetSize()
+ w = w - 50
+ if w < 900:
+ w = 900
+ h = h - 50
+ if h < 650:
+ h = 650
+ dlg = Audition(jet_file, (w,h))
+ dlg.ShowModal()
+ CleanupTempJetFile(jet_file)
+
+ def SetKeepPlayingFlag(self, val):
+ """ Sets a flag to communicate playing state to the play thread """
+ with self.playerLock:
+ self.keepPlaying = val
+
+ def GetKeepPlayingFlag(self):
+ """ Gets the playing state flag """
+ with self.playerLock:
+ return self.keepPlaying
+
+ def GraphTriggerClip(self, sClipName, iEventId):
+ """ Triggers a clip when they click on the graph """
+ with self.playerLock:
+ try:
+ self.jet.TriggerClip(iEventId)
+ self.log.SetValue(JetDefs.PLAY_TRIGGERCLIP_MSG % (iEventId, sClipName))
+ return True
+ except:
+ return False
+
+ def OnHelpJet(self, event):
+ """ Loads the jet help file """
+ import webbrowser
+ webbrowser.open(JetDefs.MAIN_HELPFILE)
+ return
+
+ def OnHelpJetGuidelines(self, event):
+ """ Loads the authoring guidelines file """
+ import webbrowser
+ webbrowser.open(JetDefs.MAIN_HELPGUIDELINESFILE)
+ return
+
+ def OnAbout(self, event):
+ """ Loads the about dialog box """
+ dlg = JetAbout()
+ result = dlg.ShowModal()
+ dlg.Destroy()
+
+ def OnJetImportArchive(self, event):
+ """ Imports a jet archive file """
+ defDir = IniGetValue(JetDefs.JETCREATOR_INI, JetDefs.INI_DEFAULTDIRS, JetDefs.ARCHIVE_FILE_SPEC, 'str', str(os.getcwd()))
+ dialog = wx.FileDialog(None, JetDefs.IMPORT_ARCHIVE_PROMPT, defDir, "", JetDefs.ARCHIVE_FILE_SPEC, wx.OPEN)
+ if dialog.ShowModal() == wx.ID_OK:
+ IniSetValue(JetDefs.JETCREATOR_INI, JetDefs.INI_DEFAULTDIRS, JetDefs.ARCHIVE_FILE_SPEC, str(FileJustPath(dialog.GetPath())))
+ defDir = IniGetValue(JetDefs.JETCREATOR_INI, JetDefs.INI_DEFAULTDIRS, JetDefs.ARCHIVE_FILE_SPEC + "Dir", 'str', str(os.getcwd()))
+ dlg1 = wx.DirDialog(self, JetDefs.IMPORT_ARCHIVEDIR_PROMPT, style=wx.DD_DEFAULT_STYLE, defaultPath=defDir)
+ if dlg1.ShowModal() == wx.ID_OK:
+ IniSetValue(JetDefs.JETCREATOR_INI, JetDefs.INI_DEFAULTDIRS, JetDefs.ARCHIVE_FILE_SPEC + "Dir", str(FileJustPath(dlg1.GetPath())))
+ if YesNo(JetDefs.MAIN_IMPORTTITLE, JetDefs.MAIN_IMPORTMSG % (dialog.GetPath(),dlg1.GetPath()), False):
+ projectPath = dlg1.GetPath()
+ zipFile = dialog.GetPath()
+ z = __import__('zipfile')
+
+ if not z.is_zipfile(zipFile):
+ wx.MessageBox(JetDefs.IMPORT_ARCHIVE_NO_JTC)
+ else:
+ zip = z.ZipFile(zipFile, 'r')
+
+ jtcFile = ""
+ fileList = zip.namelist()
+
+ isArchive = False
+ for myFile in fileList:
+ if myFile == 'JetArchive':
+ isArchive = True
+ break
+ if not isArchive:
+ wx.MessageBox(JetDefs.IMPORT_NOT_JET_ARCHIVE)
+ else:
+ for myFile in fileList:
+ if FileJustExt(myFile) == '.JTC':
+ jtcFile = myFile
+ break
+ if jtcFile == "":
+ wx.MessageBox(JetDefs.IMPORT_ARCHIVE_NO_JTC)
+ else:
+ for name in zip.namelist():
+ ext = FileJustExt(name)
+ if ext == '.MID' or ext == '.DLS' or ext == '.JET':
+ file(FileFixPath(projectPath + "/" + name), 'wb').write(zip.read(name))
+ else:
+ if len(ext) > 0 and ext != '.DS_STORE':
+ file(FileFixPath(projectPath + "/" + name), 'w').write(zip.read(name))
+ zip.close()
+ self.currentJetConfigFile = FileFixPath(projectPath + "/") + jtcFile
+ self.jet_file = JetFile(self.currentJetConfigFile, "")
+
+ #fix paths
+ self.jet_file.config.filename = FileJustRoot(self.currentJetConfigFile) + ".JET"
+ for index, segment in enumerate(self.jet_file.segments):
+ self.jet_file.segments[index].filename = FileFixPath(projectPath + "/" + segment.filename)
+ if segment.dlsfile > "":
+ self.jet_file.segments[index].dlsfile = FileFixPath(projectPath + "/" + segment.dlsfile)
+ self.jet_file.segments[index].output = FileFixPath(projectPath + "/" + segment.output)
+
+ for index, library in enumerate(self.jet_file.libraries):
+ self.jet_file.libraries[index] = FileFixPath(projectPath + "/" + library)
+
+ if ValidateConfig(self.jet_file):
+ self.jet_file.SaveJetConfig(self.currentJetConfigFile)
+ self.jet_file.WriteJetFileFromConfig(self.currentJetConfigFile)
+ self.jet_file = JetFile(self.currentJetConfigFile , "")
+ self.SetCurrentFile(self.currentJetConfigFile)
+
+ dlg1.Destroy()
+ dialog.Destroy()
+
+ def OnJetExportArchive(self, event):
+ """ Exports the current setup to an archive file """
+ self.OnJetSave(event)
+ defDir = IniGetValue(JetDefs.JETCREATOR_INI, JetDefs.INI_DEFAULTDIRS, JetDefs.ARCHIVE_FILE_SPEC, 'str', str(os.getcwd()))
+ dialog = wx.FileDialog(None, JetDefs.EXPORT_ARCHIVE_PROMPT, defDir, "", JetDefs.ARCHIVE_FILE_SPEC, wx.SAVE | wx.OVERWRITE_PROMPT )
+ if dialog.ShowModal() == wx.ID_OK:
+ IniSetValue(JetDefs.JETCREATOR_INI, JetDefs.INI_DEFAULTDIRS, JetDefs.ARCHIVE_FILE_SPEC, str(FileJustPath(dialog.GetPath())))
+ ExportJetArchive(FileJustRoot(dialog.GetPath()) + ".zip", self.currentJetConfigFile, self.jet_file)
+ dialog.Destroy()
+
+ def OnCopy(self, event):
+ """ Copies the current segment or event to the clipboard """
+ if self.currentCtrl == JetDefs.MAIN_SEGLIST:
+ if self.currentSegmentName is None:
+ return ""
+
+ segment = self.jet_file.GetSegment(self.currentSegmentName)
+ if segment == None:
+ return ""
+ self.clipBoard = JetCutCopy(self.currentCtrl, segment, self.currentSegmentName)
+ return self.currentCtrl
+ elif self.currentCtrl == JetDefs.MAIN_EVENTLIST:
+ if self.currentSegmentName is None:
+ return ""
+
+ if self.currentEventName is None:
+ return ""
+
+ segment = self.jet_file.GetSegment(self.currentSegmentName)
+ if segment == None:
+ return ""
+
+ curEvent = self.jet_file.GetEvent(self.currentSegmentName, self.currentEventName)
+ if curEvent == None:
+ return ""
+ self.clipBoard = JetCutCopy(self.currentCtrl, curEvent, self.currentSegmentName)
+ return self.currentCtrl
+
+ def OnCut(self, event):
+ """ Cuts the current segment or event to the clipboard """
+ retCopy = self.OnCopy(event)
+ if retCopy == JetDefs.MAIN_SEGLIST:
+ self.SegmentDelete(self.currentSegmentName)
+ self.LoadSegList()
+ elif retCopy == JetDefs.MAIN_EVENTLIST:
+ self.EventDelete(self.currentEventName)
+ self.LoadEventsForSeg(self.currentSegmentName)
+
+ def OnPaste(self, event):
+ """ Pastes the current segment or event from the clipboard """
+ if self.clipBoard is not None:
+ if self.currentCtrl == JetDefs.MAIN_SEGLIST and self.clipBoard.objType == JetDefs.MAIN_SEGLIST:
+ saveState = JetState(self.jet_file, self.currentSegmentIndex, self.currentEventIndex)
+ self.jet_file.segments.append(self.clipBoard.GetObj(self.jet_file.segments))
+ self.UndoAdd(saveState)
+ self.LoadSegList()
+ elif self.currentCtrl == JetDefs.MAIN_EVENTLIST and self.clipBoard.objType == JetDefs.MAIN_EVENTLIST and self.clipBoard.currentSegmentName == self.currentSegmentName:
+ for segment in self.jet_file.segments:
+ if segment.segname == self.currentSegmentName:
+ saveState = JetState(self.jet_file, self.currentSegmentIndex, self.currentEventIndex)
+ segment.jetevents.append(self.clipBoard.GetObj(segment.jetevents))
+ self.UndoAdd(saveState)
+ self.LoadEventsForSeg(self.currentSegmentName)
+ self.graph.LoadSegment(self.jet_file.GetSegment(self.currentSegmentName), showLabels=IniGetValue(self.currentJetConfigFile, JetDefs.F_GRAPHLABELS, JetDefs.F_GRAPHLABELS, 'bool', 'True'), showClips=IniGetValue(self.currentJetConfigFile, JetDefs.F_GRAPHCLIPS, JetDefs.F_GRAPHCLIPS, 'bool', 'True'), showAppEvts=IniGetValue(self.currentJetConfigFile, JetDefs.F_GRAPHAPPEVTS, JetDefs.F_GRAPHAPPEVTS, 'bool', 'True'))
+
+ def OnJetProperties(self, event):
+ """ Opens a dialog box for jetfile properties """
+ dlg = JetPropertiesDialog()
+ dlg.SetValue(JetDefs.F_JETFILENAME, self.jet_file.config.filename)
+ dlg.SetValue(JetDefs.F_COPYRIGHT, StrNoneChk(self.jet_file.config.copyright))
+ dlg.SetValue(JetDefs.F_CHASECONTROLLERS, StrNoneChk(self.jet_file.config.chase_controllers))
+ dlg.SetValue(JetDefs.F_DELETEEMPTYTRACKS, StrNoneChk(self.jet_file.config.delete_empty_tracks))
+
+ result = dlg.ShowModal()
+ if result == wx.ID_OK:
+ self.jet_file.config.filename = dlg.je.ctrls[JetDefs.F_JETFILENAME].GetValue()
+ self.jet_file.config.copyright = dlg.je.ctrls[JetDefs.F_COPYRIGHT].GetValue()
+ self.jet_file.config.chase_controllers = dlg.je.ctrls[JetDefs.F_CHASECONTROLLERS].GetValue()
+ self.jet_file.config.delete_empty_tracks = dlg.je.ctrls[JetDefs.F_DELETEEMPTYTRACKS].GetValue()
+ dlg.Destroy()
+
+ def OnPreferences(self, event):
+ """ Opens a dialog box to capture preferences and saves them to a configuration file """
+ dlg = JetPreferences()
+ dlg.SetValue(JetDefs.F_COPYRIGHT, IniGetValue(JetDefs.JETCREATOR_INI, JetDefs.INI_PREF_SECTION, JetDefs.F_COPYRIGHT))
+ dlg.SetValue(JetDefs.F_CHASECONTROLLERS, IniGetValue(JetDefs.JETCREATOR_INI, JetDefs.INI_PREF_SECTION, JetDefs.F_CHASECONTROLLERS, 'bool', True))
+ dlg.SetValue(JetDefs.F_DELETEEMPTYTRACKS, IniGetValue(JetDefs.JETCREATOR_INI, JetDefs.INI_PREF_SECTION, JetDefs.F_DELETEEMPTYTRACKS, 'bool', False))
+ result = dlg.ShowModal()
+ if result == wx.ID_OK:
+ IniSetValue(JetDefs.JETCREATOR_INI, JetDefs.INI_PREF_SECTION, JetDefs.F_COPYRIGHT, dlg.GetValue(JetDefs.F_COPYRIGHT))
+ IniSetValue(JetDefs.JETCREATOR_INI, JetDefs.INI_PREF_SECTION, JetDefs.F_CHASECONTROLLERS, dlg.GetValue(JetDefs.F_CHASECONTROLLERS))
+ IniSetValue(JetDefs.JETCREATOR_INI, JetDefs.INI_PREF_SECTION, JetDefs.F_DELETEEMPTYTRACKS, dlg.GetValue(JetDefs.F_DELETEEMPTYTRACKS))
+ dlg.Destroy()
+
+ def LoadDefaultProperties(self):
+ """ Loads default properties from the a configuration file """
+ self.jet_file.config.copyright = IniGetValue(JetDefs.JETCREATOR_INI, JetDefs.INI_PREF_SECTION, JetDefs.F_COPYRIGHT)
+ self.jet_file.config.chase_controllers = IniGetValue(JetDefs.JETCREATOR_INI, JetDefs.INI_PREF_SECTION, JetDefs.F_CHASECONTROLLERS, 'bool', True)
+ self.jet_file.config.delete_empty_tracks = IniGetValue(JetDefs.JETCREATOR_INI, JetDefs.INI_PREF_SECTION, JetDefs.F_DELETEEMPTYTRACKS, 'bool', False)
+
+ def OnClose(self, event):
+ """ Called upon closing the JetCreator main window """
+ if self.isDirty():
+ ret = YesNoCancel(JetDefs.MAIN_JETCREATOR, JetDefs.MAIN_SAVEBEFOREEXIT, True)
+ if ret == wx.ID_YES:
+ self.OnJetSave(None)
+ if ret == wx.ID_CANCEL:
+ return
+
+ if self.jet is not None:
+ SafeJetShutdown(self.playerLock, self.jet)
+ self.Destroy()
+
+ def OnPlay(self, event):
+ """ Plays the currently queued segments """
+ if self.btnPlay.GetLabel() == JetDefs.BUT_PLAY:
+ if not ValidateConfig(self.jet_file):
+ return
+
+ #make sure something is queued
+ iQueued = False
+ num = self.segList.GetItemCount()
+ for seg_num in range(num):
+ if self.segList.IsChecked(seg_num):
+ iQueued = True
+ if not iQueued:
+ InfoMsg(JetDefs.MAIN_PLAYSEG, JetDefs.MAIN_PLAYSEGMSG)
+ return
+
+ for segment in self.jet_file.segments:
+ if FileExists(segment.dlsfile):
+ if not segment.dlsfile in self.jet_file.libraries:
+ self.jet_file.libraries.append(segment.dlsfile)
+
+ self.eventList.DeleteAllItems()
+ num = self.segList.GetItemCount()
+ for seg_num in range(num):
+ if seg_num == 0: self.log.Clear()
+ if self.segList.IsChecked(seg_num):
+ segment = self.jet_file.GetSegment(getColumnText(self.segList, seg_num, 0))
+ if segment != None:
+ #so we can determine which segment is playing, make these the same
+ userID = seg_num
+ if FileExists(segment.dlsfile):
+ dls_num = FindDlsNum(self.jet_file.libraries, segment.dlsfile)
+ else:
+ dls_num = -1
+ self.queueSegs.append(QueueSeg(segment.segname, userID, seg_num, dls_num, segment.repeat, segment.transpose, segment.mute_flags))
+
+ if len(self.queueSegs) == 0:
+ return
+
+ self.btnPlay.SetLabel(JetDefs.BUT_STOP)
+
+ thread.start_new_thread(self.PlaySegs, ())
+ else:
+ with self.playerLock:
+ self.jet.Clear_Queue()
+ self.SetKeepPlayingFlag(False)
+
+ def PlaySegs(self):
+ """ Thread writes a temporary copy of the jet file, and calls the library to play it """
+ if len(self.queueSegs) == 0:
+ return
+
+ jet_file = CreateTempJetFile(self.jet_file)
+
+ if not ValidateConfig(jet_file):
+ CleanupTempJetFile(jet_file)
+ return
+
+ self.jet = JET()
+ self.jet.eas.StartWave()
+ self.jet.OpenFile(jet_file.config.filename)
+
+ lastID = -1
+
+ # queue first segment and start playback
+ Queue(self.jet, self.queueSegs[0])
+ index = 1
+ self.jet.Play()
+ self.paused = False
+
+ # continue playing until all segments are done
+ self.SetKeepPlayingFlag(True)
+ while self.GetKeepPlayingFlag():
+ self.jet.Render()
+ status = self.jet.Status()
+
+ if status.currentUserID <> lastID and status.currentUserID <> -1:
+ wx.PostEvent(self, JetStatusEvent(JetDefs.PST_PLAY, status.currentUserID))
+ lastID = status.currentUserID
+
+ # if no more segments - we're done
+ if status.numQueuedSegments == 0:
+ break
+
+ self.jet.GetAppEvent()
+
+ # if less than 2 segs queued - queue another one
+ if (index < len(self.queueSegs)) and (status.numQueuedSegments < 2):
+ Queue(self.jet, self.queueSegs[index])
+ index += 1
+
+ wx.PostEvent(self, JetStatusEvent(JetDefs.PST_UPD_LOCATION, status.location))
+
+
+ SafeJetShutdown(self.playerLock, self.jet)
+
+ self.queueSegs = []
+
+ CleanupTempJetFile(jet_file)
+
+ wx.PostEvent(self, JetStatusEvent(JetDefs.PST_DONE, None))
+
+ def OnJetStatusUpdate(self, evt):
+ """ These are screen updates called for from within the thread. Communication
+ is via a postevent call.
+ """
+ if evt.mode == JetDefs.PST_PLAY:
+ segName = getColumnText(self.segList, evt.data, 0)
+ self.LoadEventsForSeg(segName)
+ self.log.SetValue(segName)
+ ClearRowSelections(self.segList)
+ SetRowSelection(self.segList, evt.data, True)
+ elif evt.mode == JetDefs.PST_UPD_LOCATION:
+ self.graph.UpdateLocation(evt.data)
+ elif evt.mode == 3:
+ self.graph.UpdateLocation(0)
+ ClearRowSelections(self.segList)
+ self.eventList.DeleteAllItems()
+ self.SetKeepPlayingFlag(False)
+ self.btnPlay.SetLabel(JetDefs.BUT_PLAY)
+ self.btnPause.SetLabel(JetDefs.BUT_PAUSE)
+
+ def OnPause(self, evt):
+ """ Pauses the playback """
+ if self.jet is None:
+ return
+ if not self.paused:
+ self.jet.Pause()
+ self.paused = True
+ self.btnPause.SetLabel(JetDefs.BUT_RESUME)
+ else:
+ self.jet.Play()
+ self.paused = False
+ self.btnPause.SetLabel(JetDefs.BUT_PAUSE)
+
+ def isDirty(self):
+ if len(self.UndoStack) == 0 and len(self.RedoStack) == 0:
+ return False
+ else:
+ return True
+
+ def OnSetGraphOptions(self, evt):
+ """ Sets graph options """
+ IniSetValue(self.currentJetConfigFile, JetDefs.F_GRAPHLABELS, JetDefs.F_GRAPHLABELS, self.chkGraphLabels.GetValue())
+ IniSetValue(self.currentJetConfigFile, JetDefs.F_GRAPHCLIPS, JetDefs.F_GRAPHCLIPS, self.chkGraphClips.GetValue())
+ IniSetValue(self.currentJetConfigFile, JetDefs.F_GRAPHAPPEVTS, JetDefs.F_GRAPHAPPEVTS, self.chkGraphAppEvts.GetValue())
+ self.graph.LoadSegment(self.jet_file.GetSegment(self.currentSegmentName), showLabels=IniGetValue(self.currentJetConfigFile, JetDefs.F_GRAPHLABELS, JetDefs.F_GRAPHLABELS, 'bool', 'True'), showClips=IniGetValue(self.currentJetConfigFile, JetDefs.F_GRAPHCLIPS, JetDefs.F_GRAPHCLIPS, 'bool', 'True'), showAppEvts=IniGetValue(self.currentJetConfigFile, JetDefs.F_GRAPHAPPEVTS, JetDefs.F_GRAPHAPPEVTS, 'bool', 'True'))
+
+ def OnEventSortOrderChanged(self):
+ """ Called when sort order has changed """
+ IniSetValue(self.currentJetConfigFile, JetDefs.INI_EVENTSORT, JetDefs.INI_EVENTSORT_0, self.eventList.GetSortState()[0])
+ IniSetValue(self.currentJetConfigFile, JetDefs.INI_EVENTSORT, JetDefs.INI_EVENTSORT_1, self.eventList.GetSortState()[1])
+ self.LoadEventsForSeg(self.currentSegmentName)
+ self.graph.LoadSegment(self.jet_file.GetSegment(self.currentSegmentName), showLabels=IniGetValue(self.currentJetConfigFile, JetDefs.F_GRAPHLABELS, JetDefs.F_GRAPHLABELS, 'bool', 'True'), showClips=IniGetValue(self.currentJetConfigFile, JetDefs.F_GRAPHCLIPS, JetDefs.F_GRAPHCLIPS, 'bool', 'True'), showAppEvts=IniGetValue(self.currentJetConfigFile, JetDefs.F_GRAPHAPPEVTS, JetDefs.F_GRAPHAPPEVTS, 'bool', 'True'))
+
+ def EventSortCmp(self, a, b):
+ """ Sorts based on selected sort order """
+ if self.eventlistSort[0] == 0 or self.eventlistSort[0] == 1:
+ if self.eventlistSort[1] == 1:
+ return cmp(a[0].upper(), b[0].upper())
+ else:
+ return cmp(b[0].upper(), a[0].upper())
+ elif self.eventlistSort[0] == 2 or self.eventlistSort[0] == 3:
+ if self.eventlistSort[1] == 1:
+ return cmp(MbtVal(a[0]), MbtVal(b[0]))
+ else:
+ return cmp(MbtVal(b[0]), MbtVal(a[0]))
+ else:
+ return cmp(a[0], b[0])
+
+ def EventSort2(self, seq, attr):
+ """ Does Sorting """
+ intermed = map(None, map(getattr, seq, (attr,)*len(seq)), xrange(len(seq)), seq)
+ intermed.sort(self.EventSortCmp)
+ return map(operator.getitem, intermed, (-1,) * len(intermed))
+
+ def EventSort(self, lst, attr):
+ """ Does Sorting """
+ lst[:] = self.EventSort2(lst, attr)
+
+ def OnSegSortOrderChanged(self):
+ """ Called when sort order has changed """
+ IniSetValue(self.currentJetConfigFile, JetDefs.INI_SEGSORT, JetDefs.INI_SEGSORT_0, self.segList.GetSortState()[0])
+ IniSetValue(self.currentJetConfigFile, JetDefs.INI_SEGSORT, JetDefs.INI_SEGSORT_1, self.segList.GetSortState()[1])
+ self.LoadEventsForSeg(self.currentSegmentName)
+ self.graph.LoadSegment(self.jet_file.GetSegment(self.currentSegmentName), showLabels=IniGetValue(self.currentJetConfigFile, JetDefs.F_GRAPHLABELS, JetDefs.F_GRAPHLABELS, 'bool', 'True'), showClips=IniGetValue(self.currentJetConfigFile, JetDefs.F_GRAPHCLIPS, JetDefs.F_GRAPHCLIPS, 'bool', 'True'), showAppEvts=IniGetValue(self.currentJetConfigFile, JetDefs.F_GRAPHAPPEVTS, JetDefs.F_GRAPHAPPEVTS, 'bool', 'True'))
+
+ def SegSortCmp(self, a, b):
+ """ Sorts based on selected sort order """
+ if self.seglistSort[0] == 0:
+ if self.seglistSort[1] == 1:
+ return cmp(a[0].upper(), b[0].upper())
+ else:
+ return cmp(b[0].upper(), a[0].upper())
+ elif self.seglistSort[0] == 1 or self.seglistSort[0] == 2:
+ if self.seglistSort[1] == 1:
+ return cmp(FileJustName(a[0]).upper(), FileJustName(b[0]).upper())
+ else:
+ return cmp(FileJustName(b[0]).upper(), FileJustName(a[0]).upper())
+ elif self.seglistSort[0] == 3 or self.seglistSort[0] == 4:
+ if self.seglistSort[1] == 1:
+ return cmp(MbtVal(a[0]), MbtVal(b[0]))
+ else:
+ return cmp(MbtVal(b[0]), MbtVal(a[0]))
+ else:
+ return cmp(a[0], b[0])
+
+ def SegSort2(self, seq, attr):
+ """ Does Sorting """
+ intermed = map(None, map(getattr, seq, (attr,)*len(seq)), xrange(len(seq)), seq)
+ intermed.sort(self.SegSortCmp)
+ return map(operator.getitem, intermed, (-1,) * len(intermed))
+
+ def SegSort(self, lst, attr):
+ """ Does Sorting """
+ lst[:] = self.SegSort2(lst, attr)
+
+if __name__ == '__main__':
+ """ Sets the logging level, then calls the open dialog box before initializing main window"""
+
+ logLevel = IniGetValue(JetDefs.JETCREATOR_INI, JetDefs.INI_LOGGING, JetDefs.INI_LOGGING)
+ if logLevel == 'DEBUG':
+ logging.basicConfig(level=logging.DEBUG, format='%(funcName)s[%(lineno)d]: %(message)s')
+ elif logLevel == 'INFO':
+ logging.basicConfig(level=logging.INFO, format='%(funcName)s[%(lineno)d]: %(message)s')
+ elif logLevel == 'ERROR':
+ logging.basicConfig(level=logging.ERROR, format='%(funcName)s[%(lineno)d]: %(message)s')
+ elif logLevel == 'WARNING':
+ logging.basicConfig(level=logging.WARNING, format='%(funcName)s[%(lineno)d]: %(message)s')
+ else:
+ install_release_loggers()
+
+ app = wx.App(None)
+
+ if not os.path.isdir(JetDefs.TEMP_JET_DIR):
+ os.mkdir(JetDefs.TEMP_JET_DIR)
+
+ openFile = ""
+ dlg = JetOpen()
+ result = dlg.ShowModal()
+ if result == wx.ID_CANCEL:
+ dlg.Destroy()
+ elif result == JetDefs.ID_JET_IMPORT:
+ dlg.Destroy()
+
+ au = JetCreator(None, -1, "", importFlag=True)
+ app.MainLoop()
+ else:
+ openFile = dlg.fileName
+ dlg.Destroy()
+
+ au = JetCreator(None, -1, openFile)
+ app.MainLoop()
+
diff --git a/jet_tools/JetCreator/JetCreatorhlp.dat b/jet_tools/JetCreator/JetCreatorhlp.dat
new file mode 100755
index 0000000..4a08b07
--- /dev/null
+++ b/jet_tools/JetCreator/JetCreatorhlp.dat
@@ -0,0 +1,119 @@
+[EVTDLG_CTRLS]
+labels =
+play = Plays the segment with associated event attributes. To trigger the event, click the event in the timeline.
+midi file = Displays the MIDI file associated with the segment. This is pulled in from the segment attributes.
+quantize = Displays the quantization associated with the segment. This is pulled in from the segment attributes.
+cancel =
+event type = Selects the type of trigger event.
+track mutes = Displays the track mute assignments associated with the segment. This is pulled in from the segment attributes.
+event =
+pause =
+graph =
+trigger =
+replicate =
+starting m/b/t = Sets the starting measure, beat, and tick for the event.
+channel = Selects the MIDI channel for the event.
+eventid = Sets the ID of the event. Each event must have a unique ID.
+app events =
+repeat = Displays the repeat count of the segment. This is pulled in from the segment attributes.
+ok =
+track = Selects the MIDI track (not the channel) for the event.
+transpose = Displays the transpose value of the segment. This is pulled in from the segment attributes.
+un-mute =
+segment = Displays the name of the segment. This is pulled in from the segment attributes.
+event name = Identifies the name of the event.
+segment name = Identifies the name of the segment. This is pulled in from the segment attributes.
+trigger clips =
+length =
+ending m/b/t = Sets the ending measure, beat, and tick for the segment.
+dls file = Displays the DLS file associated with the segment. This is pulled in from the segment attributes.
+
+[MOVE_CTRLS]
+ok =
+move =
+starting m/b/t =
+cancel =
+preview =
+increment m/b/t =
+
+[MAIN_DIALOG_CTRLS]
+seglist = The list of segments display here. You may add, revise, or delete segments using the buttons at the left. You may also double click to edit a segment.
+eventlist = The list of events for the currently selected segment display here. Double click to edit, or use the buttons at the left to add, revise, or delete and event.
+
+[SEGDLG_CTRLS]
+labels =
+app events =
+midi file = Selects the source MIDI file from which the segment will be created.
+quantize = Selects the quantization amount for the segment. Use 0 for no quantization.
+display empty tracks =
+play segment =
+cancel = Cancels any changes and exits the segment window.
+track mutes = Checking a mute box will mute the associated track. You should mute a track if you intent to add a trigger event for that track.
+pause =
+graph =
+replicate =
+starting m/b/t = Sets the starting measure, beat, and tick for the segment.
+play midi file =
+play = Plays the segment.
+repeat = Sets the number of repeats for the segment.
+graph type =
+transpose = Sets the transposition value for the segment, in semitones (half-steps).
+audition = Click this button to audition the JET file. This is an interactive playback mode that simulates a how the JET file will work in production.
+ok = Confirms segment attributes and closes segment window.
+segment =
+segment name = Identifies the name of the segment.
+trigger clips =
+length =
+ending m/b/t = Sets the ending measure, beat, and tick for the segment.
+dls file = Selects the source DLS file, if any, for the given segment.
+
+[PREFERENCES_CTRLS]
+ok =
+preferences =
+copyright = The copyright in this field will default on new JET files. It can be overridden in the Properties setting for a specific JET file.
+chase controllers = This option will force JET to chase controllers up to the beginning of a given segment. This help keep a segment in sync with its parent MIDI file.
+cancel =
+delete empty tracks = This option will tell JET to delete any empty tracks from the output file.
+
+[REPLICATE_CTRLS]
+ok =
+replace existing items matching prefix =
+replicate =
+number =
+name prefix =
+starting m/b/t =
+cancel =
+preview =
+increment m/b/t =
+
+[JET_PROPERTIES_CTRLS]
+omit empty tracks =
+jet project properties =
+ok =
+copyright =
+chase controllers = If on, MIDI CC messages and program changes will be read from the beginning of the segment when playing or triggering events in the middle of the segment. This should almost always be checked.
+jet file =
+export = Export will collect all the source MIDI, DLS and JET files into a single .ZIP file.
+cancel =
+delete empty tracks = Selecting this will delete any empty MIDI tracks.
+
+[AUDITION_CTRLS]
+seglist = The list of segments in the JET file display here. Double click on a segment to add it to the play queue, or use the buttons below.
+tracklist = The tracks in the segment currently playing segment display here. Tracks which are muted are checked. Click on a track to toggle its mute status.
+queuelist = The currently queued segments display here. Each segment displays its current run status. You may modify the playback state with the buttons below.
+graph = The currently playing segment is displayed graphically here. You may trigger clips by clicking within their boundaries on the graph.
+
+[EXPORT_CTRLS]
+omit empty tracks = Selecting this will delete any empty MIDI tracks.
+copyright =
+chase controllers = If on, MIDI CC messages and program changes will be read from the beginning of the segment when playing or triggering events in the middle of the segment. This should almost always be checked.
+jet file =
+export = Export will collect all the source MIDI, DLS and JET files into a single .ZIP file.
+cancel =
+
+[PREFERENCES]
+cancel =
+ok =
+preferences =
+use project directories =
+
diff --git a/jet_tools/JetCreator/JetCtrls.py b/jet_tools/JetCreator/JetCtrls.py
new file mode 100755
index 0000000..9b3ca5d
--- /dev/null
+++ b/jet_tools/JetCreator/JetCtrls.py
@@ -0,0 +1,567 @@
+"""
+ File:
+ JetCtrls.py
+
+ Contents and purpose:
+ Auditions a jet file to simulate interactive music functions
+
+ Copyright (c) 2008 Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+"""
+
+import wx
+import sys
+
+from wx.lib.mixins.listctrl import CheckListCtrlMixin, ListCtrlAutoWidthMixin, ColumnSorterMixin
+from JetUtils import *
+from JetDefs import *
+
+class JetSpin(wx.SpinCtrl):
+ """ Spin control """
+ def __init__(self, parent, id=-1,value=wx.EmptyString,pos=wx.DefaultPosition,size=wx.DefaultSize,style=wx.SP_ARROW_KEYS,min=0,max=100,initial=0):
+ wx.SpinCtrl.__init__(self, parent, id=id,value=value,pos=(pos[0]-MacOffset(),pos[1]),size=size,style=style,min=min,max=max,initial=initial)
+
+ def SetValue(self, val):
+ try:
+ if type(val).__name__=='str':
+ wx.SpinCtrl.SetValue(self, int(val))
+ else:
+ wx.SpinCtrl.SetValue(self, val)
+ except:
+ wx.SpinCtrl.SetValue(self, 0)
+
+class JetSpinOneBased(JetSpin):
+ """ Spin control that's one based """
+ def __init__(self, parent, id=-1,value=wx.EmptyString,pos=wx.DefaultPosition,size=wx.DefaultSize,style=wx.SP_ARROW_KEYS,min=0,max=100,initial=0):
+ wx.SpinCtrl.__init__(self, parent, id=id,value=value,pos=(pos[0]-MacOffset(),pos[1]),size=size,style=style,min=min,max=max,initial=initial)
+
+ def SetValue(self, val):
+ try:
+ if type(val).__name__=='str':
+ wx.SpinCtrl.SetValue(self, int(val) + 1)
+ else:
+ wx.SpinCtrl.SetValue(self, val + 1)
+ except:
+ wx.SpinCtrl.SetValue(self, 1)
+
+ def GetValue(self):
+ val = wx.SpinCtrl.GetValue(self)
+ val = val - 1
+ return val
+
+class JetCheckBox(wx.CheckBox):
+ """ Checkbox control """
+ def __init__(self, parent, id=-1,label=wx.EmptyString,pos=wx.DefaultPosition,size=wx.DefaultSize):
+ wx.CheckBox.__init__(self, parent, id=id, label=label, pos=pos, size=size)
+
+ def SetValue(self, val):
+ try:
+ if type(val).__name__=='str':
+ if val == 'True':
+ val = True
+ else:
+ val = False
+ wx.CheckBox.SetValue(self, val)
+ else:
+ wx.CheckBox.SetValue(self, val)
+ except:
+ wx.CheckBox.SetValue(self, False)
+
+class JetRadioButton(wx.RadioButton):
+ """ Radio button control """
+ def __init__(self, parent, id=-1,label=wx.EmptyString,pos=wx.DefaultPosition,size=wx.DefaultSize):
+ wx.RadioButton.__init__(self, parent, id=id, label=label, pos=pos, size=size)
+
+ def SetValue(self, val):
+ try:
+ if type(val).__name__=='str':
+ if val == 'True':
+ val = True
+ else:
+ val = False
+ wx.RadioButton.SetValue(self, val)
+ else:
+ wx.RadioButton.SetValue(self, val)
+ except:
+ wx.RadioButton.SetValue(self, False)
+
+class JetListCtrl(wx.ListCtrl, ListCtrlAutoWidthMixin, ColumnSorterMixin):
+ """ List control """
+ def __init__(self, parent, id=-1, pos=wx.DefaultPosition, size=wx.DefaultSize):
+ wx.ListCtrl.__init__(self, parent, id, pos=pos, size=size, style=wx.LC_REPORT | wx.SUNKEN_BORDER)
+ ListCtrlAutoWidthMixin.__init__(self)
+ self.iCol = 0
+ self.iWidth = 0
+ self.OnSortOrderChangedAlert = None
+ self.iInitialized = False
+
+ def AddCol(self, title, width):
+ self.InsertColumn(self.iCol, title)
+ if width > 0:
+ self.SetColumnWidth(self.iCol, width)
+ else:
+ width = self.GetColumnWidth(self.iCol)
+ self.iCol += 1
+ self.iWidth = self.iWidth + width
+ self.SetSize((self.iWidth + 10, -1))
+
+ def AddRows(self, values):
+ for value in values:
+ iCol = 0
+ for row in value:
+ if iCol == 0:
+ index = self.InsertStringItem(sys.maxint, row)
+ else:
+ self.SetStringItem(index, iCol, row)
+ iCol = iCol + 1
+
+ # Used by the ColumnSorterMixin, see wx/lib/mixins/listctrl.py
+ def GetListCtrl(self):
+ return self
+
+ def InitSorting(self, cols):
+ if not self.iInitialized:
+ ColumnSorterMixin.__init__(self, cols)
+ self.iInitialized = True
+
+ def OnSortOrderChanged(self):
+ if self.OnSortOrderChangedAlert is not None:
+ self.OnSortOrderChangedAlert()
+
+ def __OnColClick(self, evt):
+ oldCol = self._col
+ self._col = col = evt.GetColumn()
+ self._colSortFlag[col] = int(not self._colSortFlag[col])
+ self.OnSortOrderChanged()
+
+class JetCheckListCtrl(wx.ListCtrl, CheckListCtrlMixin, ListCtrlAutoWidthMixin, ColumnSorterMixin):
+ """ List control with checkboxes on each line """
+ def __init__(self, parent, id=-1, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.LC_REPORT | wx.SUNKEN_BORDER):
+ wx.ListCtrl.__init__(self, parent, id, pos=pos, size=size, style=style)
+ CheckListCtrlMixin.__init__(self)
+ ListCtrlAutoWidthMixin.__init__(self)
+
+ self.iCol = 0
+ self.iWidth = 0
+ self.OnSortOrderChangedAlert = None
+ self.iInitialized = False
+
+ def AddCol(self, title, width):
+ self.InsertColumn(self.iCol, title)
+ if width > 0:
+ self.SetColumnWidth(self.iCol, width)
+ else:
+ width = self.GetColumnWidth(self.iCol)
+ self.iCol += 1
+ self.iWidth = self.iWidth + width
+ self.SetSize((self.iWidth + 10, -1))
+
+ def OnCheckItem(self, index, flag):
+ if hasattr(self, 'BindCheckBoxFct'):
+ self.BindCheckBoxFct(index, flag)
+
+ def BindCheckBox(self, fct):
+ self.BindCheckBoxFct = fct
+
+ def AddRows(self, values):
+ for value in values:
+ iCol = 0
+ for row in value:
+ if iCol == 0:
+ index = self.InsertStringItem(sys.maxint, row)
+ else:
+ self.SetStringItem(index, iCol, row)
+ iCol = iCol + 1
+
+ # Used by the ColumnSorterMixin, see wx/lib/mixins/listctrl.py
+ def GetListCtrl(self):
+ return self
+
+ def InitSorting(self, cols):
+ if not self.iInitialized:
+ ColumnSorterMixin.__init__(self, cols)
+ self.iInitialized = True
+
+ def OnSortOrderChanged(self):
+ if self.OnSortOrderChangedAlert is not None:
+ self.OnSortOrderChangedAlert()
+
+ def __OnColClick(self, evt):
+ oldCol = self._col
+ self._col = col = evt.GetColumn()
+ self._colSortFlag[col] = int(not self._colSortFlag[col])
+ self.OnSortOrderChanged()
+
+class JetTrackCtrl(JetCheckListCtrl):
+ """ List control specifically designed to show tracks in midi file """
+ def __init__(self, parent, id=-1, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.LC_REPORT | wx.SUNKEN_BORDER):
+ wx.ListCtrl.__init__(self, parent, id, pos=pos, size=size, style=style)
+ CheckListCtrlMixin.__init__(self)
+ ListCtrlAutoWidthMixin.__init__(self)
+
+ self.iCol = 0
+ self.iWidth = 0
+ self.muteFlags = 0
+
+ def SetValue(self, muteFlags):
+ self.muteFlags = muteFlags
+
+ def GetValue(self):
+ return self.muteFlags
+
+ def CheckTracks(self, muteFlags):
+ num = self.GetItemCount()
+ for iRow in range(num):
+ track_num = self.GetTrackNumber(iRow)
+ self.CheckItem(iRow, GetMute(track_num, muteFlags))
+
+ def AddTrackRow(self, track, loadEmpty=False):
+ if loadEmpty or not track.empty:
+ index = self.InsertStringItem(sys.maxint, str(track.track))
+ self.SetStringItem(index, 1, str(track.channel))
+ self.SetStringItem(index, 2, str(track.name))
+
+ def GetTrackNumber(self, index):
+ return getColumnValue(self, index, 0)
+
+class JetFileCombo():
+ """ Combo box with file open button """
+ def __init__(self, parent, pos=(0,0), size=(200,-1), title='Open File', spec='*.*', id=-1):
+ self.spec = spec
+ self.title = title
+ self.EventFire = False
+ BUTWIDTH = 20
+ BORDER = 5
+ w = size[0] - (BUTWIDTH + BORDER)
+ col = pos[0] + w + BORDER
+
+ self.cmb = wx.ComboBox(parent, id, "", pos=(pos[0]-MacOffset(),pos[1]), size=(w, -1), style=wx.CB_DROPDOWN)
+ self.btn = wx.Button(parent, -1, "...", pos=(col, pos[1]+MacOffset()), size=(BUTWIDTH,self.cmb.GetSize()[1]))
+ self.btn.Bind(wx.EVT_BUTTON, self.OnBrowse, self.btn)
+
+ def OnBrowse(self, event):
+ os = __import__('os')
+ defDir = IniGetValue(JetDefs.JETCREATOR_INI, JetDefs.INI_DEFAULTDIRS, self.spec, 'str', str(os.getcwd()))
+ if OsWindows():
+ defDir = defDir.replace('/','\\')
+ else:
+ defDir = defDir.replace('\\', '/')
+
+ dlg = wx.FileDialog(None, self.title, defDir, '', self.spec, wx.FD_OPEN)
+ ret = dlg.ShowModal()
+ if ret == wx.ID_OK:
+ IniSetValue(JetDefs.JETCREATOR_INI, JetDefs.INI_DEFAULTDIRS, self.spec, str(FileJustPath(dlg.GetPath())))
+ val = dlg.GetPath()
+
+ self.Append(val)
+ self.cmb.SetValue(val)
+
+ if self.EventFire:
+ SendEvent(self.cmb, wx.EVT_COMBOBOX.evtType[0])
+ dlg.Destroy()
+
+ def SetEventFire(self, fire):
+ self.EventFire = fire
+
+ def GetValue(self):
+ return StrNoneChk(self.cmb.GetValue())
+
+ def SetValue(self, val):
+ try:
+ self.cmb.SetValue(val)
+ except:
+ pass
+
+ def Append(self, val):
+ try:
+ self.cmb.Append(val)
+ except:
+ pass
+
+ def SetFocus(self):
+ self.cmb.SetFocus()
+
+ def SetListValues(self, list):
+ self.cmb.AppendItems(list)
+
+ def Enable(self, enable):
+ self.cmb.Enable(enable)
+ self.btn.Enable(enable)
+
+ def SetHelpText(self, Lbl):
+ self.cmb.SetHelpText(Lbl)
+ self.btn.SetHelpText(Lbl)
+
+class JetFileText():
+ """ Capture a filename with a button to browse for a file """
+ def __init__(self, parent, pos=(0,0), size=(200,-1), title='Open File', spec='*.*', id=-1):
+ self.spec = spec
+ self.title = title
+ BUTWIDTH = 20
+ BORDER = 5
+ w = size[0] - (BUTWIDTH + BORDER)
+ col = pos[0] + w + BORDER
+
+ self.txt = wx.TextCtrl(parent, id, "", pos=(pos[0]-MacOffset(),pos[1]), size=(w, -1))
+ self.btn = wx.Button(parent, -1, "...", pos=(col, pos[1]), size=(BUTWIDTH,self.txt.GetSize()[1]))
+ self.btn.Bind(wx.EVT_BUTTON, self.OnBrowse, self.btn)
+
+ def OnBrowse(self, event):
+ os = __import__('os')
+ defDir = IniGetValue(JetDefs.JETCREATOR_INI, JetDefs.INI_DEFAULTDIRS, self.spec, 'str', str(os.getcwd()))
+ if OsWindows():
+ defDir = defDir.replace('/','\\')
+ else:
+ defDir = defDir.replace('\\', '/')
+
+ dlg = wx.FileDialog(None, self.title, defDir, '', self.spec, wx.FD_OPEN)
+ ret = dlg.ShowModal()
+ if ret == wx.ID_OK:
+ IniSetValue(JetDefs.JETCREATOR_INI, JetDefs.INI_DEFAULTDIRS, self.spec, str(FileJustPath(dlg.GetPath())))
+ val = dlg.GetPath()
+ self.txt.SetValue(val)
+ dlg.Destroy()
+
+ def GetValue(self):
+ return StrNoneChk(self.txt.GetValue())
+
+ def SetValue(self, val):
+ try:
+ self.txt.SetValue(val)
+ except:
+ pass
+
+ def Append(self, val):
+ try:
+ self.txt.Append(val)
+ except:
+ pass
+
+ def SetFocus(self):
+ self.txt.SetFocus()
+
+ def Enable(self, enable):
+ self.txt.Enable(enable)
+ self.btn.Enable(enable)
+
+ def SetHelpText(self, Lbl):
+ self.txt.SetHelpText(Lbl)
+ self.btn.SetHelpText(Lbl)
+
+def YesNo(title, question, default):
+ """ Simple Yes/No question box """
+ dlg = wx.MessageDialog(None, question, title, wx.YES_NO | wx.ICON_QUESTION)
+ if dlg.ShowModal() == wx.ID_YES:
+ result = True
+ else:
+ result = False
+ dlg.Destroy()
+ return result
+
+def YesNoCancel(title, question, default):
+ """ Simple Yes/No question box """
+ dlg = wx.MessageDialog(None, question, title, wx.YES_NO | wx.CANCEL | wx.ICON_QUESTION)
+ result = dlg.ShowModal()
+ dlg.Destroy()
+ return result
+
+def ErrorMsg(title, message):
+ """ Dipslay an error message """
+ dlg = wx.MessageDialog(None, message, title, wx.ICON_ERROR)
+ dlg.ShowModal()
+ dlg.Destroy()
+
+def InfoMsg(title, message):
+ """ Displays an informational message """
+ dlg = wx.MessageDialog(None, message, title, wx.ICON_INFORMATION)
+ dlg.ShowModal()
+ dlg.Destroy()
+
+class TimeCtrl(wx.Frame):
+ """ Combination of controls to capture measure, beat, tick times """
+ def __init__(self, parent, pos=(0,0), minimums=(1,1,0), maximums=(999,4,480), value=JetDefs.MBT_DEFAULT, ctlName=''):
+ wx.Frame.__init__(self, parent, -1)
+
+ self.ChangeCallbackFct = None
+ self.ctlName = ctlName
+ self.mx = maximums
+ self.mn = minimums
+ self.maxTicks = 0
+ self.iCtrl = 0
+ p1 = pos[0]
+ top = pos[1] + MacOffset()
+ w1 = 30
+ self.time = (wx.TextCtrl(parent, -1, str(value[0]), pos=(p1, top), size=(w1, -1), style=wx.TE_NOHIDESEL),
+ wx.TextCtrl(parent, -1, str(value[1]), pos=(p1 + (w1 + 3), top), size=(w1, -1), style=wx.TE_NOHIDESEL),
+ wx.TextCtrl(parent, -1, str(value[2]), pos=(p1 + (w1 + 3) *2, top), size=(w1, -1), style=wx.TE_NOHIDESEL),
+ )
+ h = self.time[2].GetSize().height
+ w = self.time[2].GetSize().width + self.time[2].GetPosition().x + 8
+
+ self.spin = wx.SpinButton(parent, -1, (w, top), (h*2/3, h), wx.SP_VERTICAL)
+ self.spin.SetValue(1)
+ self.spin.SetRange(-999,999)
+
+ self.spin.Bind(wx.EVT_SPIN_UP, self.OnSpinUp, self.spin)
+ self.spin.Bind(wx.EVT_SPIN_DOWN, self.OnSpinDown, self.spin)
+
+ self.time[0].Bind(wx.EVT_SET_FOCUS, self.OnFocusMeasure, self.time[0] )
+ self.time[1].Bind(wx.EVT_SET_FOCUS, self.OnFocusBeat, self.time[1] )
+ self.time[2].Bind(wx.EVT_SET_FOCUS, self.OnFocusTick, self.time[2] )
+
+ self.time[0].Bind(wx.EVT_KILL_FOCUS, self.OnChangeVal, self.time[0] )
+ self.time[1].Bind(wx.EVT_KILL_FOCUS, self.OnChangeVal, self.time[1] )
+ self.time[2].Bind(wx.EVT_KILL_FOCUS, self.OnChangeVal, self.time[2] )
+
+ self.SetValue(value)
+
+ def UnBindKillFocus(self):
+ self.time[0].Unbind(wx.EVT_KILL_FOCUS, self.time[0])
+ self.time[1].Unbind(wx.EVT_KILL_FOCUS, self.time[1])
+ self.time[2].Unbind(wx.EVT_KILL_FOCUS, self.time[2])
+
+ def SetChangeCallbackFct(self, ChangeCallbackFct):
+ self.ChangeCallbackFct = ChangeCallbackFct
+
+ def OnChangeVal(self, event=None):
+ if not OsWindows():
+ self.time[self.iCtrl].SetSelection(-1,-1)
+ if int(self.time[self.iCtrl].GetValue()) > self.mx[self.iCtrl]:
+ self.time[self.iCtrl].SetValue(str(self.mx[self.iCtrl]))
+ if int(self.time[self.iCtrl].GetValue()) < self.mn[self.iCtrl]:
+ self.time[self.iCtrl].SetValue(str(self.mn[self.iCtrl]))
+ if self.ChangeCallbackFct is not None:
+ self.ChangeCallbackFct()
+ if event is not None:
+ event.Skip()
+
+ def OnSpinUp(self, event):
+ if int(self.time[self.iCtrl].GetValue()) < self.mx[self.iCtrl]:
+ self.time[self.iCtrl].SetValue(str(int(self.time[self.iCtrl].GetValue()) + 1))
+ self.OnChangeVal()
+
+ def OnSpinDown(self, event):
+ if int(self.time[self.iCtrl].GetValue()) > self.mn[self.iCtrl]:
+ self.time[self.iCtrl].SetValue(str(int(self.time[self.iCtrl].GetValue()) - 1))
+ self.OnChangeVal()
+
+ def OnFocusMeasure(self, event):
+ self.iCtrl = 0
+
+ def OnFocusBeat(self, event):
+ self.iCtrl = 1
+
+ def OnFocusTick(self, event):
+ self.iCtrl = 2
+
+ def SetValue(self, mbt):
+ try:
+ if type(mbt).__name__=='str' or type(mbt).__name__=='unicode':
+ mbt = ConvertStrTimeToTuple(mbt)
+ mbt = mbtFct(mbt, 1)
+ self.time[0].SetValue(str(mbt[0]))
+ self.time[1].SetValue(str(mbt[1]))
+ self.time[2].SetValue(str(mbt[2]))
+ except:
+ self.time[0].SetValue(str(self.mn[0]))
+ self.time[1].SetValue(str(self.mn[1]))
+ self.time[2].SetValue(str(self.mn[2]))
+ if not OsWindows():
+ self.time[0].SetSelection(-1,-1)
+ self.time[1].SetSelection(-1,-1)
+ self.time[2].SetSelection(-1,-1)
+
+ def GetValue(self, typ='str'):
+ try:
+ if typ == 'str':
+ ret = "%d:%d:%d" % (int(self.time[0].GetValue()), int(self.time[1].GetValue()), int(self.time[2].GetValue()))
+ else:
+ ret = (int(self.time[0].GetValue()), int(self.time[1].GetValue()), int(self.time[2].GetValue()))
+ except:
+ ret = self.minimums
+ return mbtFct(ret, -1)
+
+ def Enable(self, enable):
+ self.time[0].Enable(enable)
+ self.time[1].Enable(enable)
+ self.time[2].Enable(enable)
+ self.spin.Enable(enable)
+
+ def SetFocus(self):
+ self.time[0].SetFocus()
+
+ def SetMaxMbt(self, m, b, t):
+ self.mx = (m,b,t)
+
+ def GetMaxMbt(self):
+ return "%d:%d:%d" % self.mx
+
+ def SetMinMbt(self, m, b, t):
+ self.mn = (m,b,t)
+
+ def SetMaxTicks(self, maxTicks):
+ self.maxTicks = maxTicks
+
+ def GetMaxTicks(self):
+ return self.maxTicks
+
+ def SetHelpText(self, Lbl):
+ self.spin.SetHelpText(Lbl)
+ self.time[0].SetHelpText(Lbl)
+ self.time[1].SetHelpText(Lbl)
+ self.time[2].SetHelpText(Lbl)
+
+ def GetMeasure(self):
+ return int(self.time[0].GetValue())
+
+ def GetBeat(self):
+ return int(self.time[1].GetValue())
+
+ def GetTick(self):
+ return int(self.time[2].GetValue())
+
+if __name__ == '__main__':
+ """ Test code for controls """
+ class TestFrame(wx.Frame):
+ def __init__(self, parent, id, title):
+ wx.Frame.__init__(self, parent, id, title, size=(350, 220))
+
+ panel = wx.Panel(self, -1)
+
+ self.tc = TimeCtrl(panel, pos=(30, 20), maximums=(25, 4, 120), value=(2, 3, 4))
+ #tc.Enable(True)
+ #tc.SetValue((2,3,4))
+ #tc.SetValue("1:2:3")
+ #print(tc.GetValue())
+
+ js = JetSpin(panel, -1, pos=(30, 100))
+ js.SetValue("1")
+ #js.SetValue(1)
+
+ #fl = JetFileCombo(panel)
+
+ wx.EVT_CLOSE(self, self.OnClose)
+
+ self.Centre()
+ self.Show(True)
+
+ def OnClose(self, event):
+ self.tc.UnBindKillFocus()
+ self.Destroy()
+
+ app = wx.App(None)
+ TestFrame(None, -1, 'TestFrame')
+ app.MainLoop()
+
+
diff --git a/jet_tools/JetCreator/JetDebug.py b/jet_tools/JetCreator/JetDebug.py
new file mode 100755
index 0000000..dcff7a6
--- /dev/null
+++ b/jet_tools/JetCreator/JetDebug.py
@@ -0,0 +1,71 @@
+"""
+ File:
+ JetDebug.py
+
+ Contents and purpose:
+ Dumps info from various jet file structures for debugging
+
+ Copyright (c) 2008 Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+"""
+
+from JetUtils import *
+
+def DumpEvent(evt):
+ print("event_name: %s" % evt.event_name)
+ print("event_type: %s" % evt.event_type)
+ print("event_id: %d" % evt.event_id)
+ print("track_num: %d" % evt.track_num)
+ print("channel_num: %d" % evt.channel_num)
+ print("event_start: %s" % evt.event_start)
+ print("event_end: %s" % evt.event_end)
+
+def DumpQueueSeg(queueSeg):
+ print("name: %s" % queueSeg.name)
+ print("userID: %d" % queueSeg.userID)
+ print("seg_num: %d" % queueSeg.seg_num)
+ print("dls_num: %d" % queueSeg.dls_num)
+ print("repeat: %d" % queueSeg.repeat)
+ print("transpose: %d" % queueSeg.transpose)
+ print("mute_flags: %d" % queueSeg.mute_flags)
+
+def DumpSegments1(segments):
+ for segment in segments:
+ DumpSegment(segment)
+
+def DumpSegment(segment):
+ print("userID: %d" % segment.userID)
+ print("name: %s" % segment.name)
+ print("seg_num: %d" % segment.seg_num)
+ print("dls_num: %d" % segment.dls_num)
+ print("repeat: %d" % segment.repeat)
+ print("transpose: %d" % segment.transpose)
+ print("mute_flags: %d" % segment.mute_flags)
+
+def DumpSegments(segments):
+ for segment in segments:
+ DumpSegment1(segment)
+
+def DumpSegment1(segment):
+ print(segment.segname)
+ print(segment.filename)
+ print(segment.start)
+ print(segment.end)
+ print(segment.length)
+ print(segment.output)
+ print(segment.quantize)
+ print(segment.dlsfile)
+ print(segment.dump_file)
+
+
diff --git a/jet_tools/JetCreator/JetDefs.py b/jet_tools/JetCreator/JetDefs.py
new file mode 100755
index 0000000..b1e73cd
--- /dev/null
+++ b/jet_tools/JetCreator/JetDefs.py
@@ -0,0 +1,560 @@
+"""
+ File:
+ JetDefs.py
+
+ Contents and purpose:
+ Holds definitions used throughout JetCreator
+
+ Copyright (c) 2008 Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+"""
+
+import wx
+
+class JetDefs():
+ def CreateHelpIniFile(self):
+ """ Used to create the help data file for context sensitive help """
+ self.CreateHelpIniForDialog("SEGDLG_CTRLS")
+ self.CreateHelpIniForDialog("EVTDLG_CTRLS")
+ self.CreateHelpIniForDialog("PREFERENCES_CTRLS")
+ self.CreateHelpIniForDialog("JET_PROPERTIES_CTRLS")
+ self.CreateHelpIniForDialog("REPLICATE_CTRLS")
+ self.CreateHelpIniForDialog("MOVE_CTRLS")
+
+ def CreateHelpIniForDialog(self, dlgName):
+ """ Used to create the help data file for context sensitive help """
+ print("\n" + dlgName)
+ lst = getattr(self, dlgName)
+ u = __import__('JetUtils')
+ for ctrl in lst:
+ fld = ctrl[0]
+ if fld[0:2] != "fr":
+ if u.IniGetValue(self.JETCREATOR_HLP, dlgName, fld) == "":
+ u.IniSetValue(self.JETCREATOR_HLP, dlgName, fld, "")
+ print(fld)
+
+ DEFAULT_MUTE_SYNC = False
+
+ TEMP_JET_DIR = "./Tmp/"
+ TEMP_JET_CONFIG_FILE = "./Tmp/Temp.jtc"
+ UNTITLED_FILE = "Untitled.jtc"
+ JETCREATOR_INI = "JetCreator.ini"
+ JETMIDIFILES_INI = "JetMidiFiles.ini"
+ JETCREATOR_HLP = "JetCreatorhlp.dat"
+
+ #Postevent message defines
+ PST_UPD_LOCATION = 1
+ PST_PLAY = 2
+ PST_DONE = 3
+ PST_PAUSE = 4
+ PST_RESUME = 5
+ PST_MIDI_INFO = 6
+
+ #Dialog titles and prompts
+ DLG_JETOPEN = "Open Jet File"
+ DLG_PREFERENCES = "Preferences"
+ DLG_ABOUT = "About"
+ DLG_PROPERTIES = "Jet Project Properties"
+ DLG_AUDITION = "Audition Jet File"
+ DLG_REPLICATE = "Replicate Event"
+ DLG_MOVE = "Move Events"
+ MAIN_TITLEPREFIX = 'Jet Creator - '
+ MAIN_DLG_CTRLS = 'JET_CREATOR'
+ MAIN_SEGLIST = 'segList'
+ MAIN_EVENTLIST = 'eventList'
+ MAIN_ADDSEGTITLE = "Add Segments"
+ MAIN_REVSEGTITLE = "Revise Segments"
+ MAIN_ADDEVENTTITLE = "Add Event"
+ MAIN_REVEVENTTITLE = "Revise Event"
+ MAIN_CONFIRM = "Confirm Deletion"
+ MAIN_CONFIRM_SEG_DLT = "\n\nOkay to delete segment(s)?"
+ MAIN_CONRIRM_EVT_DLT = "\n\nOkay to delete event(s)?"
+ MAIN_PLAYSEG = "Play Segments"
+ MAIN_PLAYSEGMSG = "Queue one or more segments by checking them in the list, then play."
+ MAIN_HELPTITLE = "Jet Creator Help"
+ MAIN_HELPFILE = "JET Creator User Manual.htm"
+ MAIN_HELPGUIDELINESTITLE = "Jet Authoring Guidelines"
+ MAIN_HELPGUIDELINESFILE = "JET Authoring Guidelines.htm"
+ MAIN_IMPORTTITLE = "Import Project"
+ MAIN_IMPORTMSG = "Okay to import\n\n%s\n\ninto\n\n%s?"
+ MAIN_SAVEBEFOREEXIT = "Save project before exiting?"
+ MAIN_JETCREATOR = "Jet Creator"
+
+ #Audition window defines
+ AUDITION_CTRLS = 'AUDITION_CTRLS'
+ AUDITION_SEGLIST = 'segList'
+ AUDITION_QUEUELIST = 'queueList'
+ AUDITION_TRACKLIST = 'trackList'
+ AUDITION_GRAPH = 'graph'
+
+ PLAY_TRIGGERCLIP_MSG = 'Triggered Clip %d: %s'
+
+ #Config file defines
+ RECENT_SECTION = "Recent"
+ DIR_SECTION = "Directories"
+ IMAGES_DIR = "ImagesDir"
+ INI_PREF_SECTION = "Preferences"
+ INI_PROJECT_DIRS = "chkProjectDir"
+ INI_LOGGING = "Logging"
+ INI_DEFAULTDIRS = "Directories"
+ INI_DISPEMPTYTRACKS = "DisplayEmptyTracks"
+ INI_EVENTSORT = "EventSort"
+ INI_EVENTSORT_0 = "EventSort0"
+ INI_EVENTSORT_1 = "EventSort1"
+ INI_SEGSORT = "SegSort"
+ INI_SEGSORT_0 = "SegSort0"
+ INI_SEGSORT_1 = "SegSort1"
+
+ #Mbt defines
+ MBT_DEFAULT = (0,0,0)
+ MBT_MIN = 0
+ MBT_ZEROSTR = "0:0:0"
+
+ #File open dialog specs
+ APPLICATION_TITLE = "Jet Creator"
+ MIDI_FILE_SPEC = 'MIDI Files (*.mid)|*.mid|All Files (*.*)|*.*'
+ DLS_FILE_SPEC = 'DLS Files (*.dls)|*.dls|All Files (*.*)|*.*'
+ JTC_FILE_SPEC = 'Jet Content Files (*.jtc)|*.jtc|All Files (*.*)|*.*'
+ ARCHIVE_FILE_SPEC = 'Jet Archive Files (*.zip)|*.zip|All Files (*.*)|*.*'
+ OPEN_PROMPT = "Open Jet Creator File"
+ SAVE_PROMPT = "Save Jet Creator File"
+ EXPORT_ARCHIVE_PROMPT = "Save Jet Archive"
+ MUST_SAVE_FIRST = "You must save your JetCreator project before exporting it."
+ IMPORT_ARCHIVE_PROMPT = "Select the Jet Archive to import"
+ IMPORT_ARCHIVEDIR_PROMPT = "Choose a directory:\n\nYour imported project files will be placed there."
+ IMPORT_ARCHIVE_NO_JTC = "This does not appear to be a JetCreator archive file."
+ IMPORT_NOT_JET_ARCHIVE = "Not a recognized Jet Archive file."
+
+ #Button texts
+ BUT_ADD = 'Add'
+ BUT_REVISE = 'Revise'
+ BUT_DELETE = 'Delete'
+ BUT_PLAY = 'Play'
+ BUT_STOP = 'Stop'
+ BUT_MOVE = 'Move'
+ BUT_QUEUEALL = 'Queue All'
+ BUT_DEQUEUEALL = 'Dequeue All'
+ BUT_UNMUTE = 'Un-Mute'
+ BUT_MUTE = 'Mute'
+ BUT_AUDITION = 'Audition'
+ BUT_QUEUE = 'Queue'
+ BUT_MUTEALL = 'Mute All'
+ BUT_MUTENONE = 'Mute None'
+ BUT_ORGMUTES = 'Original Mutes'
+ BUT_CANCELANDQUEUE = 'Cancel && Queue'
+ BUT_CANCELCURRENT = 'Next'
+ BUT_PAUSE = 'Pause'
+ BUT_RESUME = 'Resume'
+ BUT_PLAYSEG = 'Play Segment'
+ BUT_PLAYMIDI = 'Play MIDI File'
+
+ #Grid defines
+ GRD_TRACK = "Track"
+ GRD_CHANNEL = "Channel"
+ GRD_NAME = "Name"
+ GRD_SEGMENTS = "Segments"
+ GRD_LENGTH = "Length"
+ GRD_QUEUE = "Queue"
+ GRD_STATUS = "Status"
+
+ #Menu defines
+ MNU_ADD_SEG = "Add Segment"
+ MNU_UPDATE_SEG = "Revise Segment"
+ MNU_DELETE_SEG = "Delete Segment"
+ MNU_MOVE_SEG = "Move Segment(s)"
+ MNU_ADD_EVENT = "Add Event"
+ MNU_UPDATE_EVENT = "Revise Event"
+ MNU_DELETE_EVENT = "Delete Event"
+ MNU_MOVE_EVENT = "Move Events(s)"
+ MNU_UNDO = "Undo\tctrl+z"
+ MNU_REDO = "Redo\tctrl+y"
+
+ 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."
+
+ #Status bar messages
+ SB_NEW = "New JET Creator file"
+ SB_OPEN = "Open JET Creator file"
+ SB_SAVE = "Save Jet Creator file and generate .JET output file"
+ SB_SAVEAS = "Save JET Creator file as another file"
+ SB_EXIT = "Exit the application"
+ SB_CUT = "Cuts the current segment or event to the clipboard"
+ SB_COPY = "Copies the current segment or event to the clipboard"
+ SB_PASTE = "Pastes the current segment or event from the clipboard"
+ SB_UNDO = "Undo the last segment or event edit."
+ SB_REDO = "Reverse the last segment or event undo edit."
+ SB_IMPORT_PROJ = "Imports a JetCreator project archive."
+ SB_EXPORT_PROJ = "Saves all project files to an archive."
+
+ #Defines the menus
+ MENU_SPEC = (("&File",
+ ("&New", SB_NEW, 'OnJetNew', True),
+ ("&Open...", SB_OPEN, 'OnJetOpen', True),
+ ("&Save", SB_SAVE, 'OnJetSave', True),
+ ("Save As...", SB_SAVEAS, 'OnJetSaveAs', True),
+ ("", "", "", True),
+ ("Import Project...", SB_IMPORT_PROJ, "OnJetImportArchive", True),
+ ("Export Project...", SB_EXPORT_PROJ, "OnJetExportArchive", True),
+ ("Properties...", "Sets properties specific to this Jet project", 'OnJetProperties', True),
+ ("", "", "", True),
+ ("Exit", SB_EXIT, 'OnClose', True)),
+ ("&Edit",
+ (MNU_UNDO, "Undo", 'OnUndo', False),
+ (MNU_REDO, "Redo", 'OnRedo', False),
+ ("C&ut\tctrl+x", "Cut", 'OnCut', True),
+ ("&Copy\tctrl+c", "Copy", 'OnCopy', True),
+ ("&Paste\tctrl+v", "Paste", 'OnPaste', True)),
+ ("Jet",
+ ("Preferences", "Set user preferences including defaults for new project files.", 'OnPreferences', True)),
+ ("Segments",
+ (MNU_ADD_SEG, "Add a new segment to the segment list", 'OnSegmentAdd', True),
+ (MNU_UPDATE_SEG, "Revise the segment attributes", 'OnSegmentUpdate', False),
+ (MNU_DELETE_SEG, "Delete the segment from the segment list", 'OnSegmentDelete', False),
+ (MNU_MOVE_SEG, "Move one or more segments by incrementing or decrementing their time values", 'OnSegmentsMove', False)),
+ ("Events",
+ (MNU_ADD_EVENT, "Add a new event for the currently selected segment", 'OnEventAdd', False),
+ (MNU_UPDATE_EVENT, "Revise the current event's attributes", 'OnEventUpdate', False),
+ (MNU_DELETE_EVENT, "Delete the event from the event list for this segment", 'OnEventDelete', False),
+ (MNU_MOVE_EVENT, "Move one or more events by incrementing or decrementing their time values", 'OnEventsMove', False)),
+ ("Help",
+ ("JET Creator User Manual", "Get help on the JET Creator", "OnHelpJet", True),
+ ("JET Authoring Guidelines", "Guidelines helpful for JET content creation", "OnHelpJetGuidelines", True),
+ ("About", "About the JET Creator", "OnAbout", True))
+ )
+
+ #Define the toolbar
+ TOOLBAR_SPEC = (
+ ("-", "", "", ""),
+ ("New", "img_New", SB_NEW, "OnJetNew"),
+ ("Open", "img_Open", SB_OPEN, "OnJetOpen"),
+ ("Save", "img_Save", SB_SAVE, "OnJetSave"),
+ ("-", "", "", ""),
+ ("Cut", "img_Cut", SB_CUT, "OnCut"),
+ ("Copy", "img_Copy", SB_COPY, "OnCopy"),
+ ("Paste", "img_Paste", SB_PASTE, "OnPaste"),
+ ("-", "", "", ""),
+ ("Undo", "img_Undo", SB_UNDO, "OnUndo"),
+ ("Redo", "img_Redo", SB_REDO, "OnRedo"),
+ )
+
+ F_HLPBUT = "hlpButton"
+ F_OK = "btnOk"
+ F_CANCEL = "btnCancel"
+ F_MIDIFILE = "filecmbMidiFile"
+ F_DLSFILE = "filecmbDlsFile"
+ F_SEGNAME = "txtSegName"
+ F_START = "tmStart"
+ F_END = "tmEnd"
+ F_QUANTIZE = "spnQuantize"
+ F_REPEAT = "spnRepeat"
+ F_TRANSPOSE = "spnTranspose"
+ F_MUTEFLAGS = "grd2MuteFlags"
+ F_SYNCMUTE = "chkSync"
+ F_ETYPE = "cmbEventType"
+ F_ENAME = "txtEventName"
+ F_ESTART = "tmEventStart"
+ F_EEND = "tmEventEnd"
+ F_EID = "spnEventID"
+ F_ETRACK = "spnEventTrack"
+ F_ECHANNEL = "spn1EventChannel"
+ F_EEVENTID = "spnEventID"
+ F_EMUTEBUT = "btnMute"
+ F_ETRIGGERBUT = "btnTriggerClip"
+ F_GRAPH = "graphPlay"
+ F_PAUSE = "btnPause"
+ F_ADDSEG = "btnAddSeg"
+ F_UPDSEG = "btnUpdateSeg"
+ F_DELSEG = "btnDeleteSeg"
+ F_PLAY = "btnPlay"
+ F_PLAYMIDI = "btnPlayMidi"
+ F_EASPLAY = "btnEasPlay"
+ F_ADDCLIP = "btnAddEvent"
+ F_UPDCLIP = "btnUpdateEvent"
+ F_DELCLIP = "btnDeleteEvent"
+ F_EXPORT = "btnOkExport"
+ F_JETFILENAME = "filecmbJetFileName"
+ F_COPYRIGHT = "txtCopyright"
+ F_JFILE = "filetxtJetFileName"
+ F_JOPEN = "btnOpen"
+ F_JNEW = "btnNew"
+ F_JIMPORT = "btnImport"
+ F_JLIST = "lstRecent"
+ F_ERRGRID = "grdErrors"
+ F_CHASECONTROLLERS = "chkChaseControllers"
+ F_DELETEEMPTYTRACKS = "chkDeleteEmptyTracks"
+ F_OPTMIDI = "optMidiGraph"
+ F_OPTSEG = "optSegGraph"
+ F_RDOGRAPH = "rdoboxGraphType"
+ F_DISPEMPTYTRACKS = "chkDisplayEmptyTracks"
+ F_GRAPHLABELS = "chkGraphLabels"
+ F_GRAPHCLIPS = "chkGraphClips"
+ F_GRAPHAPPEVTS = "chkGraphAppEvts"
+ F_REPLICATE = "btnReplicate"
+
+ GRAPH_LBLS = "Labels"
+ GRAPH_TRIGGER = "Trigger Clips"
+ GRAPH_APP = "App Events"
+
+ #IDs for dialogs
+ ID_JET_OPEN = 0
+ ID_JET_NEW = 1
+ ID_JET_IMPORT = 2
+
+ #Event types
+ E_CLIP = 'TriggerClip'
+ E_EOS = 'End of Segment'
+ E_APP = 'App Controller'
+
+ INTWIDTH = 70
+ TIMEWIDTH = 70
+
+ #Definitions of fields in the edit frame
+ TM_WIDTH = 100
+ TRACK_MIN = 1
+ TRACK_MAX = 32
+ EVENTID_MIN = 1
+ EVENTID_MAX = 63
+ APPCONTROLLERID_MIN = 80
+ APPCONTROLLERID_MAX = 83
+ #NEEDS TO DEFAULT TO RANGE OF BOTH POSSIBLE TYPES
+ DEFAULTID_MIN = 1
+ DEFAULTID_MAX = 100
+
+ #Mins and maxs for dialog values
+ QUANTIZE_MIN = 0
+ QUANTIZE_MAX = 9
+ CHANNEL_MIN = 1
+ CHANNEL_MAX = 16
+ TRANSPOSE_MIN = -12
+ TRANSPOSE_MAX = 12
+ REPEAT_MIN = -1
+ REPEAT_MAX = 100
+
+ #Standardize the columns
+ BUTSIZE = wx.DefaultSize
+ COLSIZE = 120
+ COL1 = 30
+ COL2 = COL1 + COLSIZE
+ COL3 = COL2 + COLSIZE
+ COL4 = COL3 + COLSIZE
+ COL5 = COL4 + COLSIZE
+ COL6 = COL5+ COLSIZE
+ COL7 = COL6 + COLSIZE
+ ROWSIZE = 50
+ ROW1 = 40
+ ROW2 = ROW1 + ROWSIZE
+ ROW3 = ROW2 + ROWSIZE
+ ROW4 = ROW3 + ROWSIZE
+ ROW5 = ROW4 + ROWSIZE
+ ROW6 = ROW5 + ROWSIZE
+ ROW7 = ROW6 + ROWSIZE
+ BUTOFF = 25
+ BUTROW1 = 25
+ FILEPATH_GRIDWIDTH = 120
+ FILEPATH_WIDTH = 250
+
+ #Segment grid column definitions
+ SEGMENT_GRID = [('Segment Name', 200, F_SEGNAME),
+ ('MIDI File', FILEPATH_GRIDWIDTH, F_MIDIFILE),
+ ('DLS File', FILEPATH_GRIDWIDTH, F_DLSFILE),
+ ('Start', TIMEWIDTH, F_START),
+ ('End', TIMEWIDTH, F_END),
+ ('Quantize', 0, F_QUANTIZE),
+ ('Transpose', 0, F_TRANSPOSE),
+ ('Repeat', 0, F_REPEAT),
+ ('Mute Flags', 0, F_MUTEFLAGS)
+ ]
+
+ #Clips grid column definitions
+ CLIPS_GRID = [('Event Name', 200, F_ENAME),
+ ('Type', 100, F_ETYPE),
+ ('Start',TIMEWIDTH, F_ESTART),
+ ('End',TIMEWIDTH, F_EEND),
+ ('Track',0, F_ETRACK),
+ ('Channel',0, F_ECHANNEL),
+ ('EventID',0, F_EEVENTID)
+ ]
+
+ #Jet open dialog control definitions
+ JETOPEN_SIZE = (365+200,360)
+ JETOPEN_CTRLS = [
+ ('Jet Creator Files', 'frCreator', 20, 20, (234+200, 244 + ROWSIZE), 0, 0, -1, [], "", True, ""),
+ ('Open', F_JOPEN, BUTROW1, COL3+200, BUTSIZE, 0, 0, ID_JET_OPEN, [], "OnOk", True, ""),
+ ('New', F_JNEW, BUTROW1+BUTOFF*1, COL3+200, BUTSIZE, 0, 0, ID_JET_NEW, [], "OnNew", True, ""),
+ ('Import', F_JIMPORT, BUTROW1+BUTOFF*2, COL3+200, BUTSIZE, 0, 0, ID_JET_IMPORT, [], "OnJetImport", True, ""),
+ ('Cancel', F_CANCEL, BUTROW1+BUTOFF*3, COL3+200, BUTSIZE, 0, 0, wx.ID_CANCEL, [], "", True, ""),
+ ('', F_JFILE, ROW1, COL1, 200+200, 0, 0, -1, JTC_FILE_SPEC, "", True, ""),
+ ('Recent Files', F_JLIST, ROW2, COL1, (200+200,200), 0, 0, -1, [], "", True, ""),
+ ]
+
+ #Jet properties dialog control definitions
+ JET_PROPERTIES_SIZE = (465,460)
+ JET_PROPERTIES_CTRLS = [
+ ('Jet Project Properties', 'frProperties', 20, 20, (334, 344 + ROWSIZE), 0, 0, -1, [], "", True, ""),
+ ('Ok', F_OK, BUTROW1, COL3+100, BUTSIZE, 0, 0, wx.ID_OK, [], "OnOk", True, ""),
+ ('Cancel', F_CANCEL, BUTROW1+BUTOFF*1, COL3+100, BUTSIZE, 0, 0, wx.ID_CANCEL, [], "", True, ""),
+ ('Jet File', F_JETFILENAME, ROW1, COL1, 300, 0, 0, -1, JTC_FILE_SPEC, "", True, ""),
+ ('Copyright', F_COPYRIGHT, ROW2, COL1, 300, 0, 0, -1, [], "", True, ""),
+ ('Chase Controllers', F_CHASECONTROLLERS, ROW3, COL1, 200, 0, 0, -1, [], "", True, ""),
+ ('Delete Empty Tracks', F_DELETEEMPTYTRACKS, ROW4 - ROWSIZE/2, COL1, 200, 0, 0, -1, [], "", True, ""),
+ ]
+
+ #Preferences dialog control definitions
+ PREFERENCES_SIZE = (465,460)
+ PREFERENCES_CTRLS = [
+ ('Preferences', 'frPreferences', 20, 20, (334, 344 + ROWSIZE), 0, 0, -1, [], "", True, ""),
+ ('Ok', F_OK, BUTROW1, COL3+100, BUTSIZE, 0, 0, wx.ID_OK, [], "OnOk", True, ""),
+ ('Cancel', F_CANCEL, BUTROW1+BUTOFF*1, COL3+100, BUTSIZE, 0, 0, wx.ID_CANCEL, [], "", True, ""),
+ ('Copyright', F_COPYRIGHT, ROW1, COL1, 300, 0, 0, -1, [], "", True, ""),
+ ('Chase Controllers', F_CHASECONTROLLERS, ROW2, COL1, 200, 0, 0, -1, [], "", True, ""),
+ ('Delete Empty Tracks', F_DELETEEMPTYTRACKS, ROW3 - ROWSIZE/2, COL1, 200, 0, 0, -1, [], "", True, ""),
+# ('Use Project Directories', INI_PROJECT_DIRS, ROW1, COL1, 150, 0, 0, -1, [], "", True, ""),
+ ]
+
+ #Error dialog control definitions
+ ERRORCOLW = 220
+ ERRORDLG_SIZE = (600,400)
+ ERRORDLG = [
+ ('Ok', F_OK, BUTROW1, 500, BUTSIZE, 0, 0, wx.ID_OK, [], "OnOk", True, ""),
+ ('', F_ERRGRID, BUTROW1, COL1, (200,300), 0, 0, -1, [], "", True, ""),
+ ]
+
+ #Event dialog control definitions
+ BGR = 100
+ EVT_OFFSET = 525+BGR
+ EVTDLG_SIZE = (375+EVT_OFFSET,530)
+ ID_MUTE = 124
+ ID_MIDIFILE = 123
+ ID_TRIGGERCLIP = 122
+ SEGFRAME_SIZE = (500+BGR, 344 + ROWSIZE)
+ TRACKGRD_SIZE = (70, SEGFRAME_SIZE[1]-50)
+ GRAPH_SIZE = (760, 50)
+ AUDCOL=190
+ EVTDLG_CTRLS = [
+ ('Segment', 'frSeg', 20, 20, SEGFRAME_SIZE, 0, 0, -1, [], "", False, ""),
+ ('Segment Name', F_SEGNAME, ROW1, COL1, 200+BGR, 0, 0, -1, [], "", False, ""),
+ ('MIDI File', F_MIDIFILE, ROW2, COL1, FILEPATH_WIDTH+BGR, 0, 0, ID_MIDIFILE, MIDI_FILE_SPEC, "", False, ""),
+ ('DLS File', F_DLSFILE, ROW3, COL1, FILEPATH_WIDTH+BGR, 0, 0, -1, DLS_FILE_SPEC, "", False, ""),
+ ('Starting M/B/T', F_START, ROW4, COL1, TM_WIDTH, 0, 0, -1, [], "", False, ""),
+ ('Ending M/B/T', F_END, ROW5, COL1, TM_WIDTH, 0, 0, -1, [], "", False, ""),
+ ('Quantize', F_QUANTIZE, ROW6, COL1, INTWIDTH, QUANTIZE_MIN, QUANTIZE_MAX, -1, [], "", False, HLP_QUANTIZE),
+ ('Repeat', F_REPEAT, ROW4, AUDCOL, INTWIDTH, REPEAT_MIN, REPEAT_MAX, -1, [], "", False, ""),
+ ('Transpose', F_TRANSPOSE, ROW5, AUDCOL, INTWIDTH, TRANSPOSE_MIN, TRANSPOSE_MAX, -1, [], "", False, ""),
+ ('Event', 'frEventg', 20+EVT_OFFSET, 20, (234, 344 + ROWSIZE), 0, 0, -1, [], "", True, ""),
+ ('Ok', F_ADDCLIP, BUTROW1, COL3+EVT_OFFSET, BUTSIZE, 0, 0, wx.ID_OK, [], "OnOk", True, ""),
+ ('Cancel', F_CANCEL, BUTROW1+BUTOFF*1, COL3+EVT_OFFSET, BUTSIZE, 0, 0, wx.ID_CANCEL, [], "OnClose", True, ""),
+ ('Replicate', F_REPLICATE, BUTROW1+BUTOFF*2, COL3+EVT_OFFSET, BUTSIZE, 0, 0, wx.ID_CANCEL, [], "OnReplicate", True, ""),
+ ('Event Name', F_ENAME, ROW1, COL1+EVT_OFFSET, 200, 0, 0, -1, [], "", True, ""),
+ ('Event Type', F_ETYPE, ROW2, COL1+EVT_OFFSET, 120, 0, 0, -1, [E_CLIP, E_EOS, E_APP], "OnEventSelect", True, ""),
+ ('Starting M/B/T', F_ESTART, ROW3, COL1+EVT_OFFSET, TM_WIDTH, 0, 0, -1, [], "", True, ""),
+ ('Ending M/B/T', F_EEND, ROW4, COL1+EVT_OFFSET, TM_WIDTH, 0, 0, -1, [], "", True, ""),
+ ('Track', F_ETRACK, ROW5, COL1+EVT_OFFSET, INTWIDTH, TRACK_MIN, TRACK_MAX, -1, [], "", True, ""),
+ ('Track Mutes', F_MUTEFLAGS, ROW1, COL3 + 15+BGR, TRACKGRD_SIZE, 0, 0, -1, [], "", False, ""),
+ ('Channel', F_ECHANNEL, ROW6, COL1+EVT_OFFSET, INTWIDTH, CHANNEL_MIN, CHANNEL_MAX, -1, [], "", True, ""),
+ ('EventID', F_EEVENTID, ROW7, COL1+EVT_OFFSET, INTWIDTH, DEFAULTID_MIN, DEFAULTID_MAX, -1, [], "", True, ""),
+ ('Play', F_PLAY, BUTROW1+BUTOFF*4, COL3+EVT_OFFSET, BUTSIZE, 0, 0, -1, [], "OnPlay", True, ""),
+ ('Trigger', F_ETRIGGERBUT, BUTROW1+BUTOFF*5, COL3+EVT_OFFSET, BUTSIZE, 0, 0, ID_TRIGGERCLIP, [], "OnTriggerClip", False, ""),
+ ('Un-Mute', F_EMUTEBUT, BUTROW1+BUTOFF*6, COL3+EVT_OFFSET, BUTSIZE, 0, 0, ID_MUTE, [], "OnMute", False, ""),
+ ('Pause', F_PAUSE, BUTROW1+BUTOFF*7, COL3+EVT_OFFSET, BUTSIZE, 0, 0, -1, [], "OnPause", False, ""),
+ ('Graph', F_GRAPH, 430, 20, (EVTDLG_SIZE[0]-40,60), 0, 0, -1, [], "", True, ""),
+ (GRAPH_LBLS, F_GRAPHLABELS, (BUTROW1+BUTOFF*10)+70, COL3+EVT_OFFSET+5, 200, 0, 0, -1, [], "OnSetGraphOptions", True, ""),
+ (GRAPH_APP, F_GRAPHCLIPS, (BUTROW1+BUTOFF*10)+90, COL3+EVT_OFFSET+5, 200, 0, 0, -1, [], "OnSetGraphOptions", True, ""),
+ (GRAPH_TRIGGER, F_GRAPHAPPEVTS, (BUTROW1+BUTOFF*10)+110, COL3+EVT_OFFSET+5, 200, 0, 0, -1, [], "OnSetGraphOptions", True, ""),
+ ("Graph", "boxGraph", (BUTROW1+BUTOFF*10)+45, COL3+EVT_OFFSET, (90,95), 0, 0, -1, [], "", True, ""),
+
+ ]
+
+ #Segment dialog control definitions
+ BGR = 100
+ AUDCOL = 560
+ COLADD = 500 + BGR
+ SEGDLG_SIZE = (890+BGR,530)
+ SEGFRAME_SIZE = (375+BGR, 394)
+ AUDFRAME_SIZE = (350, 394)
+ TRACKGRD_SIZE = (200, AUDFRAME_SIZE[1]-60)
+ MUTEGRD_TRACK = 50
+ MUTEGRD_CHANNEL = 60
+ MUTEGRD_NAME = 100
+ BIGBUT = (100, 25)
+ FILEPATH_WIDTH = 350
+ SEGDLG_CTRLS = [
+ ('Segment', 'frSeg', 20, 20, SEGFRAME_SIZE, 0, 0, -1, [], "", True, ""),
+ ('Audition', 'frAudition', SEGFRAME_SIZE[0]+30, 20, AUDFRAME_SIZE, 0, 0, -1, [], "", True, ""),
+ ('Segment Name', F_SEGNAME, ROW1, COL1, 200+BGR, 0, 0, -1, [], "", True, ""),
+ ('MIDI File', F_MIDIFILE, ROW2, COL1, FILEPATH_WIDTH+BGR, 0, 0, ID_MIDIFILE, MIDI_FILE_SPEC, "", True, ""),
+ ('DLS File', F_DLSFILE, ROW3, COL1, FILEPATH_WIDTH+BGR, 0, 0, -1, DLS_FILE_SPEC, "", True, ""),
+ ('Starting M/B/T', F_START, ROW4, COL1, TM_WIDTH, 0, 0, -1, [], "", True, ""),
+ ('Ending M/B/T', F_END, ROW5, COL1, TM_WIDTH, 0, 0, -1, [], "", True, ""),
+ ('Quantize', F_QUANTIZE, ROW6, COL1, INTWIDTH, QUANTIZE_MIN, QUANTIZE_MAX, -1, [], "", True, HLP_QUANTIZE),
+ ('Repeat', F_REPEAT, ROW1, AUDCOL+100+BGR, INTWIDTH, REPEAT_MIN, REPEAT_MAX, -1, [], "", True, ""),
+ ('Transpose', F_TRANSPOSE, ROW2, AUDCOL+100+BGR, INTWIDTH, TRANSPOSE_MIN, TRANSPOSE_MAX, -1, [], "", True, ""),
+ ('Track Mutes', F_MUTEFLAGS, ROW1, COL3 + 145+BGR, TRACKGRD_SIZE, 0, 0, -1, [], "", True, ""),
+ ('Display Empty Tracks', F_DISPEMPTYTRACKS, ROW1+TRACKGRD_SIZE[1]+20, COL3 + 145+BGR, 200, 0, 0, -1, [], "OnSetTrackDisplayOption", True, ""),
+ ('Ok', F_ADDSEG, BUTROW1, COL3 + COLADD, BIGBUT, 0, 0, wx.ID_OK, [], "OnOk", True, ""),
+ ('Cancel', F_CANCEL, BUTROW1+BUTOFF*1, COL3 + COLADD, BIGBUT, 0, 0, wx.ID_CANCEL, [], "OnClose", True, ""),
+ ('Replicate', F_REPLICATE, BUTROW1+BUTOFF*2, COL3 + COLADD, BIGBUT, 0, 0, wx.ID_CANCEL, [], "OnReplicate", True, ""),
+
+ ('Play Segment', F_PLAY, BUTROW1+BUTOFF*4, COL3 + COLADD, BIGBUT, 0, 0, -1, [], "OnPlay", True, ""),
+ ('Play MIDI File', F_PLAYMIDI, BUTROW1+BUTOFF*5, COL3 + COLADD, BIGBUT, 0, 0, -1, [], "OnPlayMidi", True, ""),
+ ('Pause', F_PAUSE, BUTROW1+BUTOFF*6, COL3 + COLADD, BIGBUT, 0, 0, -1, [], "OnPause", False, ""),
+ ('Graph', F_GRAPH, 430, 20, (SEGDLG_SIZE[0]-40,60), 0, 0, -1, [], "", True, ""),
+ ('Graph', F_RDOGRAPH, (BUTROW1+BUTOFF*10), COL3 + COLADD, (100,140), 0, 0, -1, ["MIDI File", "Segment"], "OnSetGraphType", True, ""),
+
+ (GRAPH_LBLS, F_GRAPHLABELS, (BUTROW1+BUTOFF*10)+70, COL3 + COLADD+5, 200, 0, 0, -1, [], "OnSetGraphOptions", True, ""),
+ (GRAPH_APP, F_GRAPHCLIPS, (BUTROW1+BUTOFF*10)+90, COL3 + COLADD+5, 200, 0, 0, -1, [], "OnSetGraphOptions", True, ""),
+ (GRAPH_TRIGGER, F_GRAPHAPPEVTS, (BUTROW1+BUTOFF*10)+110, COL3 + COLADD+5, 200, 0, 0, -1, [], "OnSetGraphOptions", True, ""),
+ ]
+
+
+ REPLICATE_MAX = 999
+ F_RPINCREMENT = "tmIncrement"
+ F_RPGRDPREVIEW = "grdPreview"
+ F_RPPREFIX = "txtPrefix"
+ F_RPREPLACE = "chkReplaceMatching"
+ F_RPMOVE = "chkMoveMatching"
+ F_RPNUMBER = "spnNumber"
+ F_RPBUT = "btnPreview"
+ REPLICATE_GRID = [('Event Name', 200, F_ENAME),
+ ('Start',TIMEWIDTH, F_ESTART),
+ ('End',TIMEWIDTH, F_EEND)
+ ]
+ REPLICATE_SIZE = (515,550)
+ REPLICATEGRID_SIZE = (350,310)
+ REPLICATE_CTRLS = [
+ ('Replicate', 'frRep', 20, 20, (384, 480), 0, 0, -1, [], "", True, ""),
+ ('Ok', F_OK, BUTROW1, COL3+150, BUTSIZE, 0, 0, wx.ID_OK, [], "OnOk", True, ""),
+ ('Cancel', F_CANCEL, BUTROW1+BUTOFF*1, COL3+150, BUTSIZE, 0, 0, wx.ID_CANCEL, [], "", True, ""),
+ ('Preview', F_RPBUT , BUTROW1+BUTOFF*2, COL3+150, BUTSIZE, 0, 0, -1, [], "OnPreview", True, ""),
+ ('Name Prefix', F_RPPREFIX, ROW1, COL1, 300, 0, 0, -1, [], "", True, ""),
+ ('Replace Existing Items Matching Prefix', F_RPREPLACE, ROW3, COL1, 200, 0, 0, -1, [], "", True, ""),
+ ('Preview', F_RPGRDPREVIEW, ROW4-20, COL1, REPLICATEGRID_SIZE, 0, 0, -1, [], "", True, ""),
+ ('Starting M/B/T', F_ESTART, ROW2, COL1, TM_WIDTH, 0, 0, -1, [], "", True, ""),
+ ('Increment M/B/T', F_RPINCREMENT, ROW2, COL2+20, TM_WIDTH, 0, 0, -1, [], "", True, ""),
+ ('Number', F_RPNUMBER, ROW2, COL3+40, INTWIDTH, 1, REPLICATE_MAX, -1, [], "", True, ""),
+ ]
+
+
+ MOVE_SIZE = (350,390)
+ MOVE_CTRLS = [
+ ('Move', 'frRep', 20, 20, (384, 480), 0, 0, -1, [], "", True, ""),
+ ('Ok', F_OK, BUTROW1, COL3+150, BUTSIZE, 0, 0, wx.ID_OK, [], "OnOk", True, ""),
+ ('Cancel', F_CANCEL, BUTROW1+BUTOFF*1, COL3+150, BUTSIZE, 0, 0, wx.ID_CANCEL, [], "", True, ""),
+ ('Preview', F_RPBUT , BUTROW1+BUTOFF*2, COL3+150, BUTSIZE, 0, 0, -1, [], "OnPreview", True, ""),
+ ('Starting M/B/T', F_ESTART, ROW1, COL1, TM_WIDTH, 0, 0, -1, [], "", True, ""),
+ ('Increment M/B/T', F_RPINCREMENT, ROW1, COL2+20, TM_WIDTH, 0, 0, -1, [], "", True, ""),
+ ('Preview', F_RPGRDPREVIEW, ROW2, COL1, MOVE_SIZE, 0, 0, -1, [], "", True, ""),
+ ]
+
+if __name__ == '__main__':
+ jd = JetDefs()
+ jd.CreateHelpIniFile()
diff --git a/jet_tools/JetCreator/JetDialogs.py b/jet_tools/JetCreator/JetDialogs.py
new file mode 100755
index 0000000..67d689b
--- /dev/null
+++ b/jet_tools/JetCreator/JetDialogs.py
@@ -0,0 +1,1031 @@
+"""
+ File:
+ JetDialogs.py
+
+ Contents and purpose:
+ Dialog boxes used in JetCreator
+
+ Copyright (c) 2008 Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+"""
+
+import wx
+import thread
+import wx.lib.newevent
+
+from JetDefs import *
+from JetCtrls import *
+from JetFile import *
+from JetUtils import *
+from JetPreview import *
+from JetSegGraph import *
+from eas import *
+from JetStatusEvent import *
+
+PLAY_SEGMENT = 1
+PLAY_MIDI = 2
+
+class JetEdit():
+ """ Class used to build dialog box controls from the definitions in JetDefs """
+ def __init__(self, panel, ctrlList, callbackClass):
+ LBL_OFFSET = 15
+
+ ctrls = getattr(JetDefs, ctrlList)
+ self.ctrls = {}
+ for Lbl, Text, Row, Col, Len, Min, Max, Id, Lst, Fct, Enabled, HelpText in ctrls:
+ try:
+ iDisplayLbl = True
+ if Text[0:3] == "btn":
+ self.ctrls[Text] = wx.Button(panel, Id, Lbl, wx.Point(Col, Row), size=Len)
+ if Fct > "":
+ self.ctrls[Text].Bind(wx.EVT_BUTTON, getattr(callbackClass, Fct), self.ctrls[Text], id=Id)
+ if Id == wx.ID_OK:
+ self.ctrls[Text].SetDefault()
+ iDisplayLbl = False
+ else:
+ if Text[0:3] == "txt":
+ self.ctrls[Text] = wx.TextCtrl(panel, Id, "", wx.Point(Col, Row + LBL_OFFSET +3), wx.Size(Len,-1))
+ elif Text[0:4] == "spn1":
+ self.ctrls[Text] = JetSpinOneBased(panel, Id, "", wx.Point(Col, Row + LBL_OFFSET), wx.Size(Len,-1), min=Min, max=Max)
+ elif Text[0:3] == "spn":
+ self.ctrls[Text] = JetSpin(panel, Id, "", wx.Point(Col, Row + LBL_OFFSET), wx.Size(Len,-1), min=Min, max=Max)
+ elif Text[0:3] == "cmb":
+ self.ctrls[Text] = wx.ComboBox(panel, Id, "", wx.Point(Col, Row + LBL_OFFSET), wx.Size(Len,-1), Lst, wx.CB_DROPDOWN | wx.CB_READONLY )
+ self.ctrls[Text].SetValue(Lst[0])
+ if Fct > "":
+ self.ctrls[Text].Bind(wx.EVT_COMBOBOX, getattr(callbackClass, Fct), self.ctrls[Text])
+ elif Text[0:2] == "tm":
+ self.ctrls[Text] = TimeCtrl(panel, pos=(Col, Row + LBL_OFFSET), ctlName=Text)
+ elif Text[0:7] == "filecmb":
+ self.ctrls[Text] = JetFileCombo(panel, pos=(Col, Row + LBL_OFFSET), size=wx.Size(Len,-1), title=Lbl, spec=Lst, id=Id)
+ elif Text[0:7] == "filetxt":
+ self.ctrls[Text] = JetFileText(panel, pos=(Col, Row + LBL_OFFSET), size=wx.Size(Len,-1), title=Lbl, spec=Lst, id=Id)
+ elif Text[0:2] == "fr":
+ self.ctrls[Text] = wx.StaticBox(parent=panel, id=wx.ID_ANY, label=Lbl, pos=(Row, Col), size=Len)
+ iDisplayLbl = False
+ elif Text[0:3] == "chk":
+ self.ctrls[Text] = JetCheckBox(panel, Id, label=Lbl, pos=(Col, Row), size=wx.Size(Len,-1))
+ iDisplayLbl = False
+ if Fct > "":
+ self.ctrls[Text].Bind(wx.EVT_CHECKBOX , getattr(callbackClass, Fct), self.ctrls[Text])
+ elif Text[0:6] == "rdobox":
+ self.ctrls[Text] = wx.RadioBox(panel, Id, label=Lbl, pos=(Col, Row), size=Len, choices=Lst, majorDimension=1, style=wx.RA_SPECIFY_COLS)
+ iDisplayLbl = False
+ if Fct > "":
+ self.ctrls[Text].Bind(wx.EVT_RADIOBOX , getattr(callbackClass, Fct), self.ctrls[Text])
+ elif Text[0:3] == "opt":
+ self.ctrls[Text] = JetRadioButton(panel, Id, label=Lbl, pos=(Col, Row), size=wx.Size(Len,-1))
+ iDisplayLbl = False
+ self.ctrls[Text].SetValue(Lst)
+ if Fct > "":
+ self.ctrls[Text].Bind(wx.EVT_RADIOBUTTON , getattr(callbackClass, Fct), self.ctrls[Text])
+ elif Text[0:3] == "lst":
+ self.ctrls[Text] = wx.ListBox(panel, Id, pos=(Col, Row), size=Len)
+ iDisplayLbl = False
+ elif Text[0:4] == "grd2":
+ self.ctrls[Text] = JetTrackCtrl(panel, Id, pos=(Col, Row + LBL_OFFSET), size=Len, style=wx.LC_REPORT | wx.SUNKEN_BORDER)
+ iDisplayLbl = True
+ elif Text[0:3] == "grd":
+ self.ctrls[Text] = JetListCtrl(panel, Id, pos=(Col, Row), size=Len)
+ iDisplayLbl = False
+ elif Text[0:5] == "graph":
+ self.ctrls[Text] = SegmentGraph(panel, pos=(Col, Row), size=Len)
+ iDisplayLbl = False
+ elif Text[0:3] == "hlp":
+ self.ctrls[Text] = wx.ContextHelpButton(panel, Id, pos=(Col, Row))
+ iDisplayLbl = False
+ elif Text[0:3] == "lbl":
+ self.ctrls[Text] = wx.StaticText(panel, Id, Lbl, wx.Point(Col, Row), size=wx.Size(Len[0],Len[1]))
+ iDisplayLbl = False
+ elif Text[0:3] == "box":
+ self.ctrls[Text] = wx.StaticBox(panel, wx.ID_ANY, Lbl, pos=(Col, Row), size=Len)
+ iDisplayLbl = False
+
+ if iDisplayLbl:
+ self.ctrls[Lbl] = wx.StaticText(panel, Id, Lbl, wx.Point(Col, Row))
+ if not Enabled:
+ self.ctrls[Text].Enable(False)
+
+ helpText = IniGetValue(JetDefs.JETCREATOR_HLP, ctrlList, Lbl)
+ if helpText > "":
+ self.ctrls[Text].SetHelpText(helpText)
+
+ #except AttributeError:
+ #No stub function for testing
+ #print("def " + Fct + "(self, event): pass")
+ except:
+ raise
+
+ def GetValue(self, fld):
+ """ Gets the value of a control """
+ return self.ctrls[fld].GetValue()
+
+ def SetValue(self, fld, val):
+ """ Sets the value of a control """
+ self.ctrls[fld].SetValue(val)
+
+class JetOpen(wx.Dialog):
+ """ Opens a jet definition file """
+ def __init__(self):
+ wx.Dialog.__init__(self, None, -1, JetDefs.DLG_JETOPEN)
+ self.fileName = ""
+ self.je = JetEdit(self, "JETOPEN_CTRLS", self)
+ fileList = GetRecentJetFiles()
+ self.je.ctrls[JetDefs.F_JLIST].AppendItems(fileList)
+ if len(fileList) > 0:
+ self.je.ctrls[JetDefs.F_JFILE].SetValue(fileList[0])
+ self.Bind(wx.EVT_LISTBOX_DCLICK, self.OnOpen)
+ self.Bind(wx.EVT_LISTBOX, self.OnClick)
+ self.SetSize(JetDefs.JETOPEN_SIZE)
+ self.CenterOnParent()
+
+ def OnJetImport(self, event):
+ """ Exit the dialog with flag to import """
+ self.EndModal(JetDefs.ID_JET_IMPORT)
+
+ def OnClick(self, event):
+ """ Clicking on item in listbox """
+ sValue = self.je.ctrls[JetDefs.F_JLIST].GetString(self.je.ctrls[JetDefs.F_JLIST].GetSelection())
+ self.je.ctrls[JetDefs.F_JFILE].SetValue(sValue)
+
+ def OnOpen(self, event):
+ """ Double clicking on item in listbox """
+ sValue = self.je.ctrls[JetDefs.F_JLIST].GetString(self.je.ctrls[JetDefs.F_JLIST].GetSelection())
+ self.je.ctrls[JetDefs.F_JFILE].SetValue(sValue)
+ if self.Validate():
+ self.fileName = self.je.ctrls[JetDefs.F_JFILE].GetValue()
+ AppendRecentJetFile(self.fileName)
+ self.EndModal(JetDefs.ID_JET_OPEN)
+
+ def OnOk(self, event):
+ """ Clicking the ok button """
+ if self.Validate():
+ self.fileName = self.je.ctrls[JetDefs.F_JFILE].GetValue()
+ AppendRecentJetFile(self.fileName)
+ self.EndModal(JetDefs.ID_JET_OPEN)
+
+ def OnNew(self, event):
+ """ Exit the dialog with flag to create new blank jet file """
+ self.EndModal(JetDefs.ID_JET_NEW)
+
+ def Validate(self):
+ """ Validates the filename """
+ if len(self.je.ctrls[JetDefs.F_JFILE].GetValue()) == 0:
+ InfoMsg("Jet Filename", "The Jet filename is blank.")
+ self.je.ctrls[JetDefs.F_JFILE].SetFocus()
+ return False
+ if not FileExists(self.je.ctrls[JetDefs.F_JFILE].GetValue()):
+ InfoMsg("MIDI File", "The file does not exist.")
+ self.je.ctrls[JetDefs.F_JFILE].SetFocus()
+ return False
+ return True
+
+class JetPreferences(wx.Dialog):
+ """ Preferences dialog box """
+ def __init__(self):
+ wx.Dialog.__init__(self, None, -1, JetDefs.DLG_PREFERENCES)
+ self.SetExtraStyle(wx.DIALOG_EX_CONTEXTHELP)
+ self.je = JetEdit(self, "PREFERENCES_CTRLS", self)
+ self.SetSize(JetDefs.PREFERENCES_SIZE)
+ self.CenterOnParent()
+
+ def OnOk(self, event):
+ self.EndModal(wx.ID_OK)
+
+ def GetValue(self, fld):
+ return self.je.ctrls[fld].GetValue()
+
+ def SetValue(self, fld, val):
+ self.je.ctrls[fld].SetValue(val)
+
+
+class JetAbout(wx.Dialog):
+ """ About dialog box """
+ def __init__(self):
+ wx.Dialog.__init__(self, None, -1, JetDefs.DLG_ABOUT)
+ img = __import__('img_splash')
+ bmp = img.getBitmap()
+ b = wx.StaticBitmap(self, -1, bmp)
+ self.SetSize((bmp.GetWidth(), bmp.GetHeight()))
+ self.CenterOnParent()
+ s = __import__('sys')
+ print(s.platform)
+
+ def OnOk(self, event):
+ self.EndModal(wx.ID_OK)
+
+ def GetValue(self, fld):
+ return self.je.ctrls[fld].GetValue()
+
+ def SetValue(self, fld, val):
+ self.je.ctrls[fld].SetValue(val)
+
+
+class JetPropertiesDialog(wx.Dialog):
+ """ Properties dialog box """
+ def __init__(self):
+ wx.Dialog.__init__(self, None, -1, JetDefs.DLG_PROPERTIES)
+ self.SetExtraStyle(wx.DIALOG_EX_CONTEXTHELP)
+ self.je = JetEdit(self, "JET_PROPERTIES_CTRLS", self)
+ self.SetSize(JetDefs.JET_PROPERTIES_SIZE)
+ self.CenterOnParent()
+
+ def OnOk(self, event):
+ self.EndModal(wx.ID_OK)
+
+ def GetValue(self, fld):
+ return self.je.ctrls[fld].GetValue()
+
+ def SetValue(self, fld, val):
+ self.je.ctrls[fld].SetValue(val)
+
+
+class JetErrors(wx.Dialog):
+ """ Errors dialog box """
+ def __init__(self, title):
+ wx.Dialog.__init__(self, None, -1, title)
+ self.je = JetEdit(self, "ERRORDLG", self)
+ self.SetSize(JetDefs.ERRORDLG_SIZE)
+ self.CenterOnParent()
+
+ def OnOk(self, event):
+ self.EndModal(wx.ID_OK)
+
+ def SetErrors(self, errors):
+ self.je.ctrls[JetDefs.F_ERRGRID].AddCol("Error", JetDefs.ERRORCOLW)
+ self.je.ctrls[JetDefs.F_ERRGRID].AddCol("Description", JetDefs.ERRORCOLW)
+ self.je.ctrls[JetDefs.F_ERRGRID].AddRows(errors)
+
+
+class SegEdit(wx.Dialog):
+ """ Dialog box to edit segments """
+ def __init__(self, title, currentJetConfigFile):
+ wx.Dialog.__init__(self, None, -1, title)
+ self.SetExtraStyle(wx.DIALOG_EX_CONTEXTHELP)
+ self.currentJetConfigFile = currentJetConfigFile
+ self.je = JetEdit(self, "SEGDLG_CTRLS", self)
+ self.je.ctrls[JetDefs.F_MIDIFILE].cmb.Bind(wx.EVT_KILL_FOCUS, self.OnMidiChanged)
+ self.je.ctrls[JetDefs.F_MIDIFILE].cmb.Bind(wx.EVT_COMBOBOX, self.OnMidiChanged)
+ self.je.ctrls[JetDefs.F_MIDIFILE].SetEventFire(True)
+ self.je.ctrls[JetDefs.F_MUTEFLAGS].AddCol(JetDefs.GRD_TRACK, JetDefs.MUTEGRD_TRACK)
+ self.je.ctrls[JetDefs.F_MUTEFLAGS].AddCol(JetDefs.GRD_CHANNEL, JetDefs.MUTEGRD_CHANNEL)
+ self.je.ctrls[JetDefs.F_MUTEFLAGS].AddCol(JetDefs.GRD_NAME, JetDefs.MUTEGRD_NAME)
+ self.je.ctrls[JetDefs.F_MUTEFLAGS].BindCheckBox(self.OnEventChecked)
+ self.je.ctrls[JetDefs.F_START].SetChangeCallbackFct(self.UpdateGraph)
+ self.je.ctrls[JetDefs.F_END].SetChangeCallbackFct(self.UpdateGraph)
+ self.je.ctrls[JetDefs.F_DISPEMPTYTRACKS].SetValue(IniGetValue(self.currentJetConfigFile, JetDefs.F_DISPEMPTYTRACKS, JetDefs.F_DISPEMPTYTRACKS, 'bool', 'False'))
+ self.je.ctrls[JetDefs.F_GRAPHLABELS].SetValue(IniGetValue(self.currentJetConfigFile, JetDefs.F_GRAPHLABELS, JetDefs.F_GRAPHLABELS, 'bool', 'True'))
+ self.je.ctrls[JetDefs.F_GRAPHCLIPS].SetValue(IniGetValue(self.currentJetConfigFile, JetDefs.F_GRAPHCLIPS, JetDefs.F_GRAPHCLIPS, 'bool', 'True'))
+ self.je.ctrls[JetDefs.F_GRAPHAPPEVTS].SetValue(IniGetValue(self.currentJetConfigFile, JetDefs.F_GRAPHAPPEVTS, JetDefs.F_GRAPHAPPEVTS, 'bool', 'True'))
+ self.replicatePrefix = ""
+ self.lstReplicate = []
+ self.chkReplaceMatching = False
+
+ EVT_JET_STATUS(self, self.OnJetStatusUpdate)
+ wx.EVT_CLOSE(self, self.OnClose)
+
+ self.Player = None
+ self.segment = None
+ self.graphSegment = None
+ self.jetevents = []
+ self.lastMidiFile = ""
+ self.lastMidiInfo = None
+ self.playMode = PLAY_SEGMENT
+ self.graphMode = PLAY_MIDI
+ self.SetSize(JetDefs.SEGDLG_SIZE)
+ self.CenterOnParent()
+
+ def OnClose(self, event):
+ """ Closing the dialog box """
+ self.ShutdownPlayer()
+ self.je.ctrls[JetDefs.F_START].UnBindKillFocus()
+ self.je.ctrls[JetDefs.F_END].UnBindKillFocus()
+ self.EndModal(wx.ID_CANCEL)
+
+ def ShutdownPlayer(self):
+ """ Shutdown player flag """
+ if self.Player is not None:
+ self.Player.SetKeepPlayingFlag(False)
+
+ def OnMidiChanged(self, event):
+ """ When new midi file selected, get its info """
+ self.UpdateMaxMbt()
+ event.Skip()
+
+ def UpdateMaxMbt(self):
+ """ Get midi info in thread so UI smoother """
+ thread.start_new_thread(self.UpdateMaxMbtThread, ())
+
+ def UpdateMaxMbtThread(self):
+ """ Thread to get midi file info """
+ if self.je.ctrls[JetDefs.F_MIDIFILE].GetValue() == self.lastMidiFile:
+ return
+ self.lastMidiFile = self.je.ctrls[JetDefs.F_MIDIFILE].GetValue()
+ self.lastMidiInfo = GetMidiInfo(self.je.ctrls[JetDefs.F_MIDIFILE].GetValue())
+ wx.PostEvent(self, JetStatusEvent(JetDefs.PST_MIDI_INFO, self.lastMidiInfo))
+
+ def GetValue(self, fld):
+ """ Gets a control value """
+ return self.je.ctrls[fld].GetValue()
+
+ def SetValue(self, fld, val):
+ """ Sets a control value """
+ self.je.ctrls[fld].SetValue(val)
+ if self.je.ctrls[fld] == self.je.ctrls[JetDefs.F_MIDIFILE]:
+ self.UpdateMaxMbt()
+
+ def OnOk(self, event):
+ """ Exits dialog box """
+ self.ShutdownPlayer()
+ if self.Validate():
+ self.je.ctrls[JetDefs.F_START].UnBindKillFocus()
+ self.je.ctrls[JetDefs.F_END].UnBindKillFocus()
+ self.EndModal(wx.ID_OK)
+
+ def Validate(self):
+ """ Validates the control values before exiting """
+ if not CompareMbt(self.je.ctrls[JetDefs.F_START].GetValue(), self.je.ctrls[JetDefs.F_END].GetValue()):
+ InfoMsg("Start/End", "The segment starting and ending times are illogical.")
+ self.je.ctrls[JetDefs.F_START].SetFocus()
+ return False
+ if len(self.je.ctrls[JetDefs.F_SEGNAME].GetValue()) == 0:
+ InfoMsg("Segment Name", "The segment must have a name.")
+ self.je.ctrls[JetDefs.F_SEGNAME].SetFocus()
+ return False
+ if len(self.je.ctrls[JetDefs.F_MIDIFILE].GetValue()) == 0:
+ InfoMsg("MIDI File", "The segment must have a midi file selected.")
+ self.je.ctrls[JetDefs.F_MIDIFILE].SetFocus()
+ return False
+ if not FileExists(self.je.ctrls[JetDefs.F_MIDIFILE].GetValue()):
+ InfoMsg("MIDI File", "The MIDI file does not exist.")
+ self.je.ctrls[JetDefs.F_MIDIFILE].SetFocus()
+ return False
+ if len(self.je.ctrls[JetDefs.F_DLSFILE].GetValue()) > 0:
+ if not FileExists(self.je.ctrls[JetDefs.F_DLSFILE].GetValue()):
+ InfoMsg("DLS File", "The DLS file does not exist.")
+ self.je.ctrls[JetDefs.F_DLSFILE].SetFocus()
+ return False
+ self.je.ctrls[JetDefs.F_MUTEFLAGS].SetValue(ComputeMuteFlagsFromList(self.je.ctrls[JetDefs.F_MUTEFLAGS]))
+ return True
+
+ def SetSegment(self, mode):
+ """ Builds the segment info for graphing """
+ if mode == PLAY_SEGMENT:
+ jetevents = self.jetevents
+ segment = JetSegment(self.GetValue(JetDefs.F_SEGNAME),
+ self.GetValue(JetDefs.F_MIDIFILE),
+ self.GetValue(JetDefs.F_START),
+ self.GetValue(JetDefs.F_END),
+ JetDefs.MBT_ZEROSTR,
+ self.GetValue(JetDefs.F_SEGNAME),
+ self.GetValue(JetDefs.F_QUANTIZE),
+ jetevents,
+ self.GetValue(JetDefs.F_DLSFILE),
+ None,
+ self.GetValue(JetDefs.F_TRANSPOSE),
+ self.GetValue(JetDefs.F_REPEAT),
+ self.GetValue(JetDefs.F_MUTEFLAGS))
+ else:
+ jetevents = []
+ segment = JetSegment(self.GetValue(JetDefs.F_SEGNAME),
+ self.GetValue(JetDefs.F_MIDIFILE),
+ JetDefs.MBT_ZEROSTR,
+ self.lastMidiInfo.endMbtStr,
+ JetDefs.MBT_ZEROSTR,
+ self.GetValue(JetDefs.F_SEGNAME),
+ self.GetValue(JetDefs.F_QUANTIZE),
+ jetevents,
+ self.GetValue(JetDefs.F_DLSFILE),
+ None,
+ 0,
+ 0,
+ 0)
+ return segment
+
+ def OnEventChecked(self, index, checked):
+ """ Track is checked so mute or unmute it """
+ if self.Player is not None:
+ trackNum = self.je.ctrls[JetDefs.F_MUTEFLAGS].GetTrackNumber(index)
+ self.Player.SetMuteFlag(trackNum, checked)
+
+ def OnPlay(self, event):
+ """ Play the segment button pressed """
+ if self.je.ctrls[JetDefs.F_PLAY].GetLabel() == JetDefs.BUT_STOP:
+ self.Player.SetKeepPlayingFlag(False)
+ return
+
+ if not self.Validate():
+ return
+
+ self.playMode = PLAY_SEGMENT
+ self.graphSegment = self.SetSegment(self.graphMode)
+ self.UpdateGraph()
+ self.Player = PreviewPlayer(self.je.ctrls[JetDefs.F_PLAY], self.SetSegment(self.playMode))
+ self.Player.SetGraphCtrl(self.je.ctrls[JetDefs.F_GRAPH], self)
+ self.PlayerThread = thread.start_new_thread(self.Player .Start, ())
+
+ def OnPlayMidi(self, event):
+ """ Play the whole midi file pressed """
+ if self.je.ctrls[JetDefs.F_PLAYMIDI].GetLabel() == JetDefs.BUT_STOP:
+ self.Player.SetKeepPlayingFlag(False)
+ return
+
+ if not self.Validate():
+ return
+
+ self.playMode = PLAY_MIDI
+ self.graphSegment = self.SetSegment(self.graphMode)
+ self.UpdateGraph()
+ self.Player = PreviewPlayer(self.je.ctrls[JetDefs.F_PLAYMIDI], self.SetSegment(self.playMode))
+ self.Player.SetGraphCtrl(self.je.ctrls[JetDefs.F_GRAPH], self)
+ self.PlayerThread = thread.start_new_thread(self.Player .Start, ())
+
+ def OnSetGraphType(self, event):
+ """ Sets the type of graph """
+ self.SetGraphType(event.GetInt())
+
+ def SetGraphType(self, iMode):
+ """ Sets the type of graph """
+ if iMode == 1:
+ self.graphMode = PLAY_SEGMENT
+ else:
+ self.graphMode = PLAY_MIDI
+ self.graphSegment = self.SetSegment(self.graphMode)
+ self.UpdateGraph()
+
+ def OnGraphUpdate(self, evt):
+ """ Calls graph control to draw """
+ self.je.ctrls[JetDefs.F_GRAPH].DoDrawing()
+
+ def UpdateGraph(self):
+ """ Updates values for graph control """
+ if self.graphMode == PLAY_SEGMENT:
+ self.je.ctrls[JetDefs.F_GRAPH].LoadSegment(self.graphSegment, showLabels=IniGetValue(self.currentJetConfigFile, JetDefs.F_GRAPHLABELS, JetDefs.F_GRAPHLABELS, 'bool', 'True'), showClips=IniGetValue(self.currentJetConfigFile, JetDefs.F_GRAPHCLIPS, JetDefs.F_GRAPHCLIPS, 'bool', 'True'), showAppEvts=IniGetValue(self.currentJetConfigFile, JetDefs.F_GRAPHAPPEVTS, JetDefs.F_GRAPHAPPEVTS, 'bool', 'True'))
+ else:
+ if self.playMode == PLAY_SEGMENT:
+ iMidiMode = True
+ else:
+ iMidiMode = False
+ self.je.ctrls[JetDefs.F_GRAPH].LoadSegment(self.graphSegment,(self.GetValue(JetDefs.F_SEGNAME), self.GetValue(JetDefs.F_START), self.GetValue(JetDefs.F_END)), iMidiMode, showLabels=IniGetValue(self.currentJetConfigFile, JetDefs.F_GRAPHLABELS, JetDefs.F_GRAPHLABELS, 'bool', 'True'), showClips=IniGetValue(self.currentJetConfigFile, JetDefs.F_GRAPHCLIPS, JetDefs.F_GRAPHCLIPS, 'bool', 'True'), showAppEvts=IniGetValue(self.currentJetConfigFile, JetDefs.F_GRAPHAPPEVTS, JetDefs.F_GRAPHAPPEVTS, 'bool', 'True'))
+
+ def OnJetStatusUpdate(self, evt):
+ """ All UI needed by thread must be called via Postevent or OS X crashes """
+ if evt.mode == JetDefs.PST_UPD_LOCATION:
+ self.je.ctrls[JetDefs.F_GRAPH].UpdateLocation(evt.data)
+ elif evt.mode == JetDefs.PST_PLAY:
+ if self.playMode == PLAY_SEGMENT:
+ self.je.ctrls[JetDefs.F_PLAY].SetLabel(JetDefs.BUT_STOP)
+ self.je.ctrls[JetDefs.F_PLAYMIDI].Enabled = False
+ else:
+ self.je.ctrls[JetDefs.F_RDOGRAPH].Enabled = False
+ self.je.ctrls[JetDefs.F_PLAYMIDI].SetLabel(JetDefs.BUT_STOP)
+ self.je.ctrls[JetDefs.F_PLAY].Enabled = False
+
+ self.je.ctrls[JetDefs.F_PAUSE].Enabled = True
+ self.je.ctrls[JetDefs.F_PAUSE].SetLabel(JetDefs.BUT_PAUSE)
+ elif evt.mode == JetDefs.PST_DONE:
+ self.je.ctrls[JetDefs.F_RDOGRAPH].Enabled = True
+ if self.playMode == PLAY_SEGMENT:
+ self.je.ctrls[JetDefs.F_PLAY].SetLabel(JetDefs.BUT_PLAYSEG)
+ self.je.ctrls[JetDefs.F_PLAYMIDI].Enabled = True
+ else:
+ self.je.ctrls[JetDefs.F_PLAYMIDI].SetLabel(JetDefs.BUT_PLAYMIDI)
+ self.je.ctrls[JetDefs.F_PLAY].Enabled = True
+
+ self.je.ctrls[JetDefs.F_PAUSE].Enabled = False
+ self.je.ctrls[JetDefs.F_PAUSE].SetLabel(JetDefs.BUT_PAUSE)
+ elif evt.mode == JetDefs.PST_PAUSE:
+ self.je.ctrls[JetDefs.F_PAUSE].SetLabel(JetDefs.BUT_RESUME)
+ elif evt.mode == JetDefs.PST_RESUME:
+ self.je.ctrls[JetDefs.F_PAUSE].SetLabel(JetDefs.BUT_PAUSE)
+ elif evt.mode == JetDefs.PST_MIDI_INFO:
+ ClearRowSelections(self.je.ctrls[JetDefs.F_MUTEFLAGS])
+ self.md = evt.data
+ if self.md.err == 0:
+ self.je.ctrls[JetDefs.F_END].SetMaxMbt(self.md.maxMeasures+1,self.md.maxBeats,self.md.maxTicks)
+ if self.je.ctrls[JetDefs.F_END].GetValue() == JetDefs.MBT_ZEROSTR:
+ self.je.ctrls[JetDefs.F_END].SetValue((self.md.maxMeasures,0,0))
+ self.je.ctrls[JetDefs.F_START].SetMaxMbt(self.md.maxMeasures+1,self.md.maxBeats,self.md.maxTicks)
+ self.je.ctrls[JetDefs.F_MUTEFLAGS].DeleteAllItems()
+ loadEmpty = IniGetValue(self.currentJetConfigFile, JetDefs.INI_DISPEMPTYTRACKS, JetDefs.INI_DISPEMPTYTRACKS, 'bool', 'False')
+ for track in self.md.trackList:
+ self.je.ctrls[JetDefs.F_MUTEFLAGS].AddTrackRow(track, loadEmpty)
+ self.je.ctrls[JetDefs.F_MUTEFLAGS].CheckTracks(self.je.ctrls[JetDefs.F_MUTEFLAGS].GetValue())
+ self.graphSegment = self.SetSegment(self.graphMode)
+ self.UpdateGraph()
+
+ def OnSetTrackDisplayOption(self, evt):
+ IniSetValue(self.currentJetConfigFile, JetDefs.INI_DISPEMPTYTRACKS, JetDefs.INI_DISPEMPTYTRACKS, self.je.ctrls[JetDefs.F_DISPEMPTYTRACKS].GetValue())
+ loadEmpty = IniGetValue(self.currentJetConfigFile, JetDefs.INI_DISPEMPTYTRACKS, JetDefs.INI_DISPEMPTYTRACKS, 'bool', 'False')
+ if self.md is not None:
+ self.je.ctrls[JetDefs.F_MUTEFLAGS].DeleteAllItems()
+ if self.md.err == 0:
+ for track in self.md.trackList:
+ self.je.ctrls[JetDefs.F_MUTEFLAGS].AddTrackRow(track, loadEmpty)
+
+ def OnPause(self, evt):
+ """ Pauses the playback """
+ self.Player.Pause()
+
+ def OnSetGraphOptions(self, evt):
+ """ Sets graph options """
+ IniSetValue(self.currentJetConfigFile, JetDefs.F_GRAPHLABELS, JetDefs.F_GRAPHLABELS, self.je.ctrls[JetDefs.F_GRAPHLABELS].GetValue())
+ IniSetValue(self.currentJetConfigFile, JetDefs.F_GRAPHAPPEVTS, JetDefs.F_GRAPHAPPEVTS, self.je.ctrls[JetDefs.F_GRAPHAPPEVTS].GetValue())
+ IniSetValue(self.currentJetConfigFile, JetDefs.F_GRAPHCLIPS, JetDefs.F_GRAPHCLIPS, self.je.ctrls[JetDefs.F_GRAPHCLIPS].GetValue())
+ self.UpdateGraph()
+
+ def OnReplicate(self, evt):
+ dlg = JetReplicate("Replicate Segment")
+ dlg.SetValue(JetDefs.F_RPREPLACE, True)
+ dlg.SetName(self.GetValue(JetDefs.F_SEGNAME))
+ dlg.event_type = "SEGMENT"
+ dlg.event_max = self.je.ctrls[JetDefs.F_START].GetMaxMbt()
+ dlg.length = MbtDifference(ConvertStrTimeToTuple(self.GetValue(JetDefs.F_START)), ConvertStrTimeToTuple(self.GetValue(JetDefs.F_END)))
+ result = dlg.ShowModal()
+ if result == wx.ID_OK:
+ self.replicatePrefix = dlg.GetValue(JetDefs.F_RPPREFIX)
+ self.lstReplicate = dlg.lstReplicate
+ self.chkReplaceMatching = dlg.GetValue(JetDefs.F_RPREPLACE)
+ self.EndModal(wx.ID_OK)
+ else:
+ dlg.Destroy()
+
+class EventEdit(wx.Dialog):
+ """ Event edit dialog box """
+ def __init__(self, title, currentJetConfigFile):
+ wx.Dialog.__init__(self, None, -1, title)
+ self.SetExtraStyle(wx.DIALOG_EX_CONTEXTHELP)
+ self.title = title
+ self.currentJetConfigFile = currentJetConfigFile
+ self.je = JetEdit(self, "EVTDLG_CTRLS", self)
+ self.je.ctrls[JetDefs.F_MUTEFLAGS].AddCol(JetDefs.GRD_TRACK, JetDefs.MUTEGRD_TRACK)
+ self.je.ctrls[JetDefs.F_MUTEFLAGS].AddCol(JetDefs.GRD_CHANNEL, JetDefs.MUTEGRD_CHANNEL)
+ self.je.ctrls[JetDefs.F_MUTEFLAGS].AddCol(JetDefs.GRD_NAME, JetDefs.MUTEGRD_NAME)
+ self.je.ctrls[JetDefs.F_ESTART].SetChangeCallbackFct(self.UpdateGraph)
+ self.je.ctrls[JetDefs.F_EEND].SetChangeCallbackFct(self.UpdateGraph)
+ self.je.ctrls[JetDefs.F_GRAPHLABELS].SetValue(IniGetValue(self.currentJetConfigFile, JetDefs.F_GRAPHLABELS, JetDefs.F_GRAPHLABELS, 'bool', 'True'))
+ self.je.ctrls[JetDefs.F_GRAPHCLIPS].SetValue(IniGetValue(self.currentJetConfigFile, JetDefs.F_GRAPHCLIPS, JetDefs.F_GRAPHCLIPS, 'bool', 'True'))
+ self.je.ctrls[JetDefs.F_GRAPHAPPEVTS].SetValue(IniGetValue(self.currentJetConfigFile, JetDefs.F_GRAPHAPPEVTS, JetDefs.F_GRAPHAPPEVTS, 'bool', 'True'))
+ EVT_JET_STATUS(self, self.OnJetStatusUpdate)
+ self.segment = None
+ self.Player = None
+ self.event_id = 1
+ self.replicatePrefix = ""
+ self.lstReplicate = []
+ self.chkReplaceMatching = False
+
+ wx.EVT_CLOSE(self, self.OnClose)
+ self.SetSize(JetDefs.EVTDLG_SIZE)
+ self.CenterOnParent()
+
+ def OnGraphUpdate(self, evt):
+ """ Calls the graph module to update the graph """
+ self.je.ctrls[JetDefs.F_GRAPH].DoDrawing()
+
+ def OnJetStatusUpdate(self, evt):
+ """ Updates to UI needed by play thread come through here otherwise OS X crashes """
+ if evt.mode == JetDefs.PST_UPD_LOCATION:
+ self.je.ctrls[JetDefs.F_GRAPH].UpdateLocation(evt.data)
+ elif evt.mode == JetDefs.PST_PLAY:
+ self.je.ctrls[JetDefs.F_PAUSE].SetLabel(JetDefs.BUT_PAUSE)
+ self.je.ctrls[JetDefs.F_PLAY].SetLabel(JetDefs.BUT_STOP)
+ self.je.ctrls[JetDefs.F_PAUSE].Enabled = True
+ self.je.ctrls[JetDefs.F_ETRIGGERBUT].Enabled = True
+ self.je.ctrls[JetDefs.F_EMUTEBUT].Enabled = True
+ elif evt.mode == JetDefs.PST_DONE:
+ self.je.ctrls[JetDefs.F_EMUTEBUT].SetLabel(JetDefs.BUT_UNMUTE)
+ self.je.ctrls[JetDefs.F_PLAY].SetLabel(JetDefs.BUT_PLAY)
+ self.je.ctrls[JetDefs.F_PAUSE].Enabled = False
+ self.je.ctrls[JetDefs.F_PAUSE].SetLabel(JetDefs.BUT_PAUSE)
+ self.je.ctrls[JetDefs.F_ETRIGGERBUT].Enabled = False
+ self.je.ctrls[JetDefs.F_EMUTEBUT].Enabled = False
+ elif evt.mode == JetDefs.PST_PAUSE:
+ self.je.ctrls[JetDefs.F_PAUSE].SetLabel(JetDefs.BUT_RESUME)
+ elif evt.mode == JetDefs.PST_RESUME:
+ self.je.ctrls[JetDefs.F_PAUSE].SetLabel(JetDefs.BUT_PAUSE)
+
+ def OnPause(self, evt):
+ """ Pause the player """
+ self.Player.Pause()
+
+ def UpdateGraph(self):
+ """ Called back from player thread to update the graph """
+ if len(self.segment.jetevents) == 0:
+ self.segment.jetevents.append(JetEvent(self.je.ctrls[JetDefs.F_ENAME].GetValue(),
+ self.je.ctrls[JetDefs.F_ETYPE].GetValue(),
+ 1,
+ self.je.ctrls[JetDefs.F_ETRACK].GetValue(),
+ self.je.ctrls[JetDefs.F_ECHANNEL].GetValue(),
+ self.je.ctrls[JetDefs.F_ESTART].GetValue(),
+ self.je.ctrls[JetDefs.F_EEND].GetValue()))
+
+ self.segment.jetevents[0].event_name = self.je.ctrls[JetDefs.F_ENAME].GetValue()
+ self.segment.jetevents[0].event_type = self.je.ctrls[JetDefs.F_ETYPE].GetValue()
+ self.segment.jetevents[0].event_start = self.je.ctrls[JetDefs.F_ESTART].GetValue()
+ self.segment.jetevents[0].event_end = self.je.ctrls[JetDefs.F_EEND].GetValue()
+ self.je.ctrls[JetDefs.F_GRAPH].LoadSegment(self.segment, showLabels=IniGetValue(self.currentJetConfigFile, JetDefs.F_GRAPHLABELS, JetDefs.F_GRAPHLABELS, 'bool', 'True'), showClips=IniGetValue(self.currentJetConfigFile, JetDefs.F_GRAPHCLIPS, JetDefs.F_GRAPHCLIPS, 'bool', 'True'), showAppEvts=IniGetValue(self.currentJetConfigFile, JetDefs.F_GRAPHAPPEVTS, JetDefs.F_GRAPHAPPEVTS, 'bool', 'True'))
+
+ def OnClose(self, event):
+ """ Called when dialog is closed """
+ self.ShutdownPlayer()
+ self.je.ctrls[JetDefs.F_ESTART].UnBindKillFocus()
+ self.je.ctrls[JetDefs.F_EEND].UnBindKillFocus()
+ self.EndModal(wx.ID_CANCEL)
+
+ def ShutdownPlayer(self):
+ """ Sets flag to kill play loop """
+ if self.Player is not None:
+ self.Player.SetKeepPlayingFlag(False)
+
+ def GetValue(self, fld):
+ """ Gets the value of a control """
+ return self.je.ctrls[fld].GetValue()
+
+ def SetValue(self, fld, val):
+ """ Sets the value of a control """
+ self.je.ctrls[fld].SetValue(val)
+
+ def SetEventId(self):
+ """ Sets the eventid value """
+ if self.title == JetDefs.MAIN_ADDEVENTTITLE:
+ iNextEventId = -1
+ for evt in self.segment.jetevents:
+ if evt.event_type == JetDefs.E_CLIP:
+ if iNextEventId < evt.event_id:
+ iNextEventId = evt.event_id
+ self.je.ctrls[JetDefs.F_EEVENTID].SetValue(iNextEventId + 1)
+
+ def OnEventSelect(self, event=None):
+ """ Adjusts the dialog box controls for various types of events """
+ eType = self.je.ctrls[JetDefs.F_ETYPE].GetValue()
+ if eType == JetDefs.E_EOS:
+ self.je.ctrls[JetDefs.F_ENAME].SetValue(JetDefs.E_EOS)
+ self.je.ctrls[JetDefs.F_ENAME].Enable(False)
+ self.je.ctrls[JetDefs.F_ESTART].Enable(False)
+ self.je.ctrls[JetDefs.F_EEND].Enable(True)
+ self.je.ctrls[JetDefs.F_ETRIGGERBUT].Enable(False)
+ self.je.ctrls[JetDefs.F_EEVENTID].Enable(False)
+ elif eType == JetDefs.E_CLIP:
+ if len(self.je.ctrls[JetDefs.F_ENAME].GetValue()) == 0 or self.je.ctrls[JetDefs.F_ENAME].GetValue() == JetDefs.E_EOS or self.je.ctrls[JetDefs.F_ENAME].GetValue() == JetDefs.E_APP:
+ self.je.ctrls[JetDefs.F_ENAME].SetValue(JetDefs.E_CLIP)
+ self.je.ctrls[JetDefs.F_ENAME].Enable(True)
+ self.je.ctrls[JetDefs.F_ESTART].Enable(True)
+ self.je.ctrls[JetDefs.F_EEND].Enable(True)
+ self.je.ctrls[JetDefs.F_ETRIGGERBUT].Enable(True)
+ self.je.ctrls[JetDefs.F_EEVENTID].Enable(True)
+ self.je.ctrls[JetDefs.F_EEVENTID].SetRange(JetDefs.EVENTID_MIN, JetDefs.EVENTID_MAX)
+ if self.je.ctrls[JetDefs.F_EEVENTID].GetValue() < JetDefs.EVENTID_MIN:
+ self.je.ctrls[JetDefs.F_EEVENTID].SetValue(JetDefs.EVENTID_MIN)
+ if self.je.ctrls[JetDefs.F_EEVENTID].GetValue() > JetDefs.EVENTID_MAX:
+ self.je.ctrls[JetDefs.F_EEVENTID].SetValue(JetDefs.EVENTID_MAX)
+ self.SetEventId()
+ elif eType == JetDefs.E_APP:
+ if len(self.je.ctrls[JetDefs.F_ENAME].GetValue()) == 0 or self.je.ctrls[JetDefs.F_ENAME].GetValue() == JetDefs.E_EOS:
+ self.je.ctrls[JetDefs.F_ENAME].SetValue(JetDefs.E_APP)
+ self.je.ctrls[JetDefs.F_ENAME].Enable(True)
+ self.je.ctrls[JetDefs.F_ESTART].Enable(True)
+ self.je.ctrls[JetDefs.F_EEND].Enable(False)
+ self.je.ctrls[JetDefs.F_ETRIGGERBUT].Enable(False)
+ self.je.ctrls[JetDefs.F_EEVENTID].Enable(True)
+ self.je.ctrls[JetDefs.F_EEVENTID].SetRange(JetDefs.APPCONTROLLERID_MIN, JetDefs.APPCONTROLLERID_MAX)
+ if self.je.ctrls[JetDefs.F_EEVENTID].GetValue() < JetDefs.APPCONTROLLERID_MIN:
+ self.je.ctrls[JetDefs.F_EEVENTID].SetValue(JetDefs.APPCONTROLLERID_MIN)
+ if self.je.ctrls[JetDefs.F_EEVENTID].GetValue() > JetDefs.APPCONTROLLERID_MAX:
+ self.je.ctrls[JetDefs.F_EEVENTID].SetValue(JetDefs.APPCONTROLLERID_MAX)
+
+ def OnOk(self, event):
+ """ Exits the dialog box """
+ self.ShutdownPlayer()
+ if self.Validate():
+ self.je.ctrls[JetDefs.F_ESTART].UnBindKillFocus()
+ self.je.ctrls[JetDefs.F_EEND].UnBindKillFocus()
+ self.EndModal(wx.ID_OK)
+
+ def Validate(self):
+ """ Validates the control values prior to exiting """
+ if len(self.je.ctrls[JetDefs.F_ENAME].GetValue()) == 0:
+ InfoMsg("Event Name", "The event must have a name.")
+ self.je.ctrls[JetDefs.F_ENAME].SetFocus()
+ return False
+ if len(self.je.ctrls[JetDefs.F_ETYPE].GetValue()) == 0:
+ InfoMsg("Event Name", "The event type must be selected.")
+ self.je.ctrls[JetDefs.F_ETYPE].SetFocus()
+ return False
+ if self.je.ctrls[JetDefs.F_ETYPE].GetValue() == JetDefs.E_CLIP:
+ if not CompareMbt(self.je.ctrls[JetDefs.F_ESTART].GetValue(), self.je.ctrls[JetDefs.F_EEND].GetValue()):
+ InfoMsg("Start/End", "The event starting and ending times are illogical.")
+ self.je.ctrls[JetDefs.F_ESTART].SetFocus()
+ return False
+ if MbtVal(self.je.ctrls[JetDefs.F_ESTART].GetValue()) < MbtVal(self.je.ctrls[JetDefs.F_START].GetValue()):
+ InfoMsg("Event Starting Time", "The event starting time is illogical.")
+ self.je.ctrls[JetDefs.F_ESTART].SetFocus()
+ return False
+ if MbtVal(self.je.ctrls[JetDefs.F_EEND].GetValue()) > MbtVal(self.je.ctrls[JetDefs.F_END].GetValue()):
+ InfoMsg("Event Ending Time", "The event ending time is illogical.")
+ self.je.ctrls[JetDefs.F_ESTART].SetFocus()
+ return False
+ if self.je.ctrls[JetDefs.F_ETYPE].GetValue() == JetDefs.E_APP:
+ self.je.ctrls[JetDefs.F_EEND].SetValue(self.je.ctrls[JetDefs.F_ESTART].GetValue())
+ if self.je.ctrls[JetDefs.F_ETYPE].GetValue() == JetDefs.E_EOS:
+ self.je.ctrls[JetDefs.F_ESTART].SetValue(self.je.ctrls[JetDefs.F_EEND].GetValue())
+ return True
+
+ def SetSegment(self, segment):
+ """ Sets the segment values, then calls the graph update """
+ self.segment = segment
+ md = GetMidiInfo(segment.filename)
+ if md.err == 0:
+ self.SetValue(JetDefs.F_SEGNAME, segment.segname)
+ self.SetValue(JetDefs.F_MUTEFLAGS, segment.mute_flags)
+ self.SetValue(JetDefs.F_MIDIFILE, segment.filename)
+ self.SetValue(JetDefs.F_DLSFILE, segment.dlsfile)
+ self.SetValue(JetDefs.F_START, segment.start)
+ self.SetValue(JetDefs.F_END, segment.end)
+ self.SetValue(JetDefs.F_QUANTIZE, segment.quantize)
+ self.SetValue(JetDefs.F_TRANSPOSE, segment.transpose)
+ self.SetValue(JetDefs.F_REPEAT, segment.repeat)
+ maxMeasures = abs(int(self.je.ctrls[JetDefs.F_END].GetValue('int')[0]))
+ self.je.ctrls[JetDefs.F_EEND].SetMaxMbt(maxMeasures+1,md.maxBeats,md.maxTicks)
+ self.je.ctrls[JetDefs.F_ESTART].SetMaxMbt(maxMeasures+1,md.maxBeats,md.maxTicks)
+ minMeasures = abs(int(self.je.ctrls[JetDefs.F_START].GetValue('int')[0]))
+ self.je.ctrls[JetDefs.F_EEND].SetMinMbt(minMeasures+1,0,0)
+ self.je.ctrls[JetDefs.F_ESTART].SetMinMbt(minMeasures+1,0,0)
+ self.je.ctrls[JetDefs.F_END].GetValue('int')
+ self.je.ctrls[JetDefs.F_ETRACK].SetRange(1, md.maxTracks)
+ self.je.ctrls[JetDefs.F_MUTEFLAGS].DeleteAllItems()
+ for track in md.trackList:
+ self.je.ctrls[JetDefs.F_MUTEFLAGS].AddTrackRow(track)
+ self.je.ctrls[JetDefs.F_MUTEFLAGS].CheckTracks(self.je.ctrls[JetDefs.F_MUTEFLAGS].GetValue())
+ self.je.ctrls[JetDefs.F_MUTEFLAGS].SetTextColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_GRAYTEXT))
+ self.je.ctrls[JetDefs.F_GRAPH].LoadSegment(segment, showLabels=IniGetValue(self.currentJetConfigFile, JetDefs.F_GRAPHLABELS, JetDefs.F_GRAPHLABELS, 'bool', 'True'), showClips=IniGetValue(self.currentJetConfigFile, JetDefs.F_GRAPHCLIPS, JetDefs.F_GRAPHCLIPS, 'bool', 'True'), showAppEvts=IniGetValue(self.currentJetConfigFile, JetDefs.F_GRAPHAPPEVTS, JetDefs.F_GRAPHAPPEVTS, 'bool', 'True'))
+
+ def OnPlay(self, event):
+ """ Plays the segment allowing interaction with events """
+ if self.je.ctrls[JetDefs.F_PLAY].GetLabel() == JetDefs.BUT_STOP:
+ self.Player.SetKeepPlayingFlag(False)
+ return
+
+ if not self.Validate():
+ return
+
+ jetevents = []
+ jetevents.append(JetEvent(self.GetValue(JetDefs.F_ENAME), self.GetValue(JetDefs.F_ETYPE),
+ self.event_id, int(self.GetValue(JetDefs.F_ETRACK)),
+ int(self.GetValue(JetDefs.F_ECHANNEL)),
+ self.GetValue(JetDefs.F_ESTART), self.GetValue(JetDefs.F_EEND)))
+
+ segment = JetSegment(self.GetValue(JetDefs.F_SEGNAME),
+ self.GetValue(JetDefs.F_MIDIFILE),
+ self.GetValue(JetDefs.F_START),
+ self.GetValue(JetDefs.F_END),
+ JetDefs.MBT_ZEROSTR,
+ self.GetValue(JetDefs.F_SEGNAME),
+ self.GetValue(JetDefs.F_QUANTIZE),
+ jetevents,
+ self.GetValue(JetDefs.F_DLSFILE),
+ None,
+ self.GetValue(JetDefs.F_TRANSPOSE),
+ self.GetValue(JetDefs.F_REPEAT),
+ self.GetValue(JetDefs.F_MUTEFLAGS))
+
+ self.Player = PreviewPlayer(self.je.ctrls[JetDefs.F_PLAY], segment)
+ self.Player.SetGraphCtrl(self.je.ctrls[JetDefs.F_GRAPH], self)
+ self.je.ctrls[JetDefs.F_GRAPH].ClickCallbackFct = self.GraphTriggerClip
+ self.Player.trigger_button = self.je.ctrls[JetDefs.F_ETRIGGERBUT]
+ self.Player.mute_button = self.je.ctrls[JetDefs.F_EMUTEBUT]
+ thread.start_new_thread(self.Player .Start, ())
+
+ def GraphTriggerClip(self, sClipName, iEventId):
+ """ Triggers a clip via graph """
+ if self.Player is not None:
+ self.Player.GraphTriggerClip(sClipName, iEventId)
+
+ def OnMute(self, event):
+ """ Mutes a track """
+ if self.Player is not None:
+ self.Player.MuteTrackViaButton(self.je.ctrls[JetDefs.F_EMUTEBUT],
+ int(self.je.ctrls[JetDefs.F_ETRACK].GetValue()))
+
+ def OnTriggerClip(self, event):
+ """ Triggers a clip """
+ if self.Player is not None:
+ self.Player.TriggerClip(self.event_id)
+
+ def OnSetGraphOptions(self, evt):
+ """ Sets graph options """
+ IniSetValue(self.currentJetConfigFile, JetDefs.F_GRAPHLABELS, JetDefs.F_GRAPHLABELS, self.je.ctrls[JetDefs.F_GRAPHLABELS].GetValue())
+ IniSetValue(self.currentJetConfigFile, JetDefs.F_GRAPHAPPEVTS, JetDefs.F_GRAPHAPPEVTS, self.je.ctrls[JetDefs.F_GRAPHAPPEVTS].GetValue())
+ IniSetValue(self.currentJetConfigFile, JetDefs.F_GRAPHCLIPS, JetDefs.F_GRAPHCLIPS, self.je.ctrls[JetDefs.F_GRAPHCLIPS].GetValue())
+ self.UpdateGraph()
+
+ def OnReplicate(self, evt):
+ dlg = JetReplicate("Replicate Event")
+ dlg.SetValue(JetDefs.F_RPREPLACE, True)
+ dlg.SetName(self.GetValue(JetDefs.F_ENAME))
+ dlg.event_type = self.GetValue(JetDefs.F_ETYPE)
+ dlg.event_max = self.segment.end
+ dlg.length = MbtDifference(ConvertStrTimeToTuple(self.GetValue(JetDefs.F_ESTART)), ConvertStrTimeToTuple(self.GetValue(JetDefs.F_EEND)))
+ result = dlg.ShowModal()
+ if result == wx.ID_OK:
+ self.replicatePrefix = dlg.GetValue(JetDefs.F_RPPREFIX)
+ self.lstReplicate = dlg.lstReplicate
+ self.chkReplaceMatching = dlg.GetValue(JetDefs.F_RPREPLACE)
+ self.EndModal(wx.ID_OK)
+ else:
+ dlg.Destroy()
+
+class JetReplicate(wx.Dialog):
+ """ Replicate dialog box """
+ def __init__(self, title):
+ wx.Dialog.__init__(self, None, -1, title)
+ self.SetExtraStyle(wx.DIALOG_EX_CONTEXTHELP)
+ self.je = JetEdit(self, "REPLICATE_CTRLS", self)
+
+ self.je.ctrls[JetDefs.F_RPINCREMENT].SetMinMbt(0,0,0)
+ self.je.ctrls[JetDefs.F_RPINCREMENT].SetValue((-1,-1,-1))
+ self.je.ctrls[JetDefs.F_RPNUMBER].SetValue(1)
+ for title, width, fld in JetDefs.REPLICATE_GRID:
+ self.je.ctrls[JetDefs.F_RPGRDPREVIEW].AddCol(title, width)
+ self.lstReplicate = []
+
+ self.SetSize(JetDefs.REPLICATE_SIZE)
+ self.CenterOnParent()
+
+ def OnOk(self, event):
+ self.EndModal(wx.ID_OK)
+
+ def GetValue(self, fld):
+ return self.je.ctrls[fld].GetValue()
+
+ def SetValue(self, fld, val):
+ self.je.ctrls[fld].SetValue(val)
+
+ def SetName(self, name):
+ for i in range(len(name), 1, -1):
+ if not name[i-1].isdigit() and name[i-1] <> ' ':
+ break
+ else:
+ name = name[0:i-1]
+ self.SetValue(JetDefs.F_RPPREFIX, name)
+
+ def Validate(self):
+ if self.GetValue(JetDefs.F_RPPREFIX) == '':
+ InfoMsg("Message", "Prefix is required.")
+ return False
+ return True
+
+ def OnPreview(self, event):
+ if not self.Validate():
+ return
+ start = MbtVal(self.GetValue(JetDefs.F_ESTART))
+ max = MbtVal(self.event_max)
+ increment = MbtVal((self.je.ctrls[JetDefs.F_RPINCREMENT].GetMeasure(), self.je.ctrls[JetDefs.F_RPINCREMENT].GetBeat(), self.je.ctrls[JetDefs.F_RPINCREMENT].GetTick()))
+
+ self.lstReplicate = []
+ iTo = int(self.GetValue(JetDefs.F_RPNUMBER))
+ for i in range(iTo):
+ evt_name = "%s %.2d" % (self.GetValue(JetDefs.F_RPPREFIX), i)
+ s_ticks = start + (i * increment)
+ s_mbt = TicksToMbt(s_ticks)
+ evt_start = "%d:%d:%d" % (s_mbt[0]+1, s_mbt[1]+1, s_mbt[2])
+ if self.event_type == JetDefs.E_CLIP or self.event_type == "SEGMENT":
+ e_ticks = s_ticks + self.length
+ e_mbt = TicksToMbt(e_ticks)
+ evt_end = "%d:%d:%d" % (e_mbt[0]+1, e_mbt[1]+1, e_mbt[2])
+ else:
+ e_ticks = s_ticks
+ evt_end = evt_start
+ if s_ticks <= max and e_ticks <= max:
+ self.lstReplicate.append((evt_name, evt_start, evt_end))
+
+ self.je.ctrls[JetDefs.F_RPGRDPREVIEW].DeleteAllItems()
+ self.je.ctrls[JetDefs.F_RPGRDPREVIEW].AddRows(self.lstReplicate)
+
+class JetMove(wx.Dialog):
+ """ Move events dialog box """
+ def __init__(self, title):
+ wx.Dialog.__init__(self, None, -1, title)
+ self.SetExtraStyle(wx.DIALOG_EX_CONTEXTHELP)
+ self.je = JetEdit(self, "MOVE_CTRLS", self)
+
+ self.je.ctrls[JetDefs.F_RPINCREMENT].SetMinMbt(-999,-4,-480)
+ self.je.ctrls[JetDefs.F_RPINCREMENT].SetValue((-1,-1,-1))
+ for title, width, fld in JetDefs.REPLICATE_GRID:
+ self.je.ctrls[JetDefs.F_RPGRDPREVIEW].AddCol(title, width)
+ self.lstMove = []
+ self.lstMoveMbt = []
+ self.lstMoveItems = []
+
+ self.SetSize(JetDefs.REPLICATE_SIZE)
+ self.CenterOnParent()
+
+ def OnOk(self, event):
+ self.EndModal(wx.ID_OK)
+
+ def GetValue(self, fld):
+ return self.je.ctrls[fld].GetValue()
+
+ def SetValue(self, fld, val):
+ self.je.ctrls[fld].SetValue(val)
+
+ def OnPreview(self, event):
+ increment = MbtVal((abs(self.je.ctrls[JetDefs.F_RPINCREMENT].GetMeasure()), abs(self.je.ctrls[JetDefs.F_RPINCREMENT].GetBeat()), abs(self.je.ctrls[JetDefs.F_RPINCREMENT].GetTick())))
+ if self.je.ctrls[JetDefs.F_RPINCREMENT].GetMeasure() < 0 or self.je.ctrls[JetDefs.F_RPINCREMENT].GetBeat() < 0 or self.je.ctrls[JetDefs.F_RPINCREMENT].GetTick() < 0:
+ increment = 0 - increment
+ self.lstMove = []
+ self.lstMoveMbt = []
+ for itm in self.lstMoveItems:
+ max = MbtVal(itm[3])
+ evt_name = itm[0]
+ start = MbtVal(itm[1])
+ s_ticks = start + increment
+
+ s_mbt = TicksToMbt(s_ticks)
+ evt_start = "%d:%d:%d" % (s_mbt[0]+1, s_mbt[1]+1, s_mbt[2])
+ evt_start_save = "%d:%d:%d" % s_mbt
+
+ end = MbtVal(itm[2])
+ e_ticks = end + increment
+ e_mbt = TicksToMbt(e_ticks)
+ evt_end = "%d:%d:%d" % (e_mbt[0]+1, e_mbt[1]+1, e_mbt[2])
+ evt_end_save = "%d:%d:%d" % e_mbt
+
+ if s_ticks <= max and e_ticks <= max and s_ticks >= 0 and e_ticks >= 0:
+ self.lstMove.append((evt_name, evt_start, evt_end))
+ self.lstMoveMbt.append((evt_name, evt_start_save, evt_end_save))
+
+ self.je.ctrls[JetDefs.F_RPGRDPREVIEW].DeleteAllItems()
+ self.je.ctrls[JetDefs.F_RPGRDPREVIEW].AddRows(self.lstMove)
+
+if __name__ == '__main1__':
+ """ Test dialogs """
+ app = wx.PySimpleApp()
+
+ #dlg = JetOpen()
+ #dlg = JetPropertiesDialog()
+ #dlg = ExportDialog("Export Jet File")
+ #dlg = JetAbout()
+
+ dlg = JetReplicate("Replicate Event")
+ dlg.SetValue(JetDefs.F_RPREPLACE, True)
+ dlg.event_max = "5:0:0"
+ dlg.event_type = JetDefs.E_APP
+ dlg.length = 480
+ dlg.SetName("abc 02")
+ result = dlg.ShowModal()
+ if result == wx.ID_OK:
+ print("OK")
+
+ dlg.Destroy()
+
+if __name__ == '__main1__':
+ """ Test Segment dialog """
+ app = wx.PySimpleApp()
+
+ helpProvider = wx.SimpleHelpProvider()
+ wx.HelpProvider_Set(helpProvider)
+
+ dlg = SegEdit("Segments", JetDefs.UNTITLED_FILE)
+ dlg.SetValue(JetDefs.F_SEGNAME, "Test Segment Name")
+ dlg.SetValue(JetDefs.F_MIDIFILE, '/Users/BHruska/JetContent/jenn_Burning Line.mid')
+ dlg.SetValue(JetDefs.F_MIDIFILE, 'C:/_Data/JetCreator/JetDemo1/jenn_Burning Line.mid')
+ dlg.SetValue(JetDefs.F_DLSFILE, '')
+ dlg.SetValue(JetDefs.F_START, '4:0:0')
+ dlg.SetValue(JetDefs.F_END, '8:0:0')
+ dlg.SetValue(JetDefs.F_QUANTIZE, 6)
+
+ result = dlg.ShowModal()
+ dlg.Destroy()
+
+if __name__ == '__main__':
+ """ Test Event dialog """
+ app = wx.PySimpleApp()
+
+ jetevents = []
+
+ segment = JetSegment("Test Segment Name", 'C:/_Data/JetCreator/JetDemo1/jenn_Burning Line.mid',
+ '0:0:0', '4:0:0', None,
+ "Test Segment Name", 6, jetevents,
+ '', None, 0,0,3)
+
+ dlg = EventEdit("Event Edit", JetDefs.UNTITLED_FILE)
+ dlg.SetValue(JetDefs.F_ENAME, "Test Event Name")
+ dlg.SetValue(JetDefs.F_ETYPE, "TriggerClip")
+ dlg.SetSegment(segment)
+
+ result = dlg.ShowModal()
+ dlg.Destroy()
+
+
+
diff --git a/jet_tools/JetCreator/JetFile.py b/jet_tools/JetCreator/JetFile.py
new file mode 100755
index 0000000..d29db7e
--- /dev/null
+++ b/jet_tools/JetCreator/JetFile.py
@@ -0,0 +1,775 @@
+"""
+ File:
+ JetFile.py
+
+ Contents and purpose:
+ Auditions a jet file to simulate interactive music functions
+
+ Copyright (c) 2008 Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+"""
+
+from __future__ import with_statement
+
+import logging
+import ConfigParser
+import struct
+import os
+import sys
+import midifile
+
+from JetUtils import *
+from JetDefs import *
+
+VERSION = '0.1'
+
+# JET file defines
+JET_HEADER_STRUCT = '<4sl'
+JET_HEADER_TAG = 'JET '
+JET_VERSION = 0x01000000
+
+# JET chunk tags
+JET_INFO_CHUNK = 'JINF'
+JET_SMF_CHUNK = 'JSMF'
+JET_DLS_CHUNK = 'JDLS'
+
+# JINF defines
+JINF_STRUCT = '<4sl4sl4sl4sl'
+JINF_JET_VERSION = 'JVER'
+JINF_NUM_SMF_CHUNKS = 'SMF#'
+JINF_NUM_DLS_CHUNKS = 'DLS#'
+
+# JCOP defines
+JCOP_STRUCT = '<4sl'
+JCOP_CHUNK = 'JCOP'
+
+# JAPP defines
+JAPP_STRUCT = '<4sl'
+JAPP_CHUNK = 'JAPP'
+
+# config file defines
+OUTPUT_SECTION = 'output'
+OUTPUT_FILENAME = 'filename'
+OUTPUT_COPYRIGHT = 'copyright'
+OUTPUT_APP_DATA = 'app_data'
+OUTPUT_CHASE_CONTROLLERS = 'chase_controllers'
+OUTPUT_OMIT_EMPTY_TRACKS = 'omit_empty_tracks'
+SEGMENT_SECTION = 'segment'
+SEGMENT_FILENAME = 'filename'
+SEGMENT_DLSFILE = 'dlsfile'
+SEGMENT_NAME = 'segname'
+SEGMENT_START = 'start'
+SEGMENT_END = 'end'
+SEGMENT_END_MARKER = 'end_marker'
+SEGMENT_QUANTIZE = 'quantize'
+SEGMENT_OUTPUT = 'output'
+SEGMENT_LENGTH = 'length'
+SEGMENT_DUMP_FILE = 'dump'
+SEGMENT_TRANSPOSE = 'transpose'
+SEGMENT_REPEAT = 'repeat'
+SEGMENT_MUTE_FLAGS = 'mute_flags'
+LIBRARY_SECTION = 'libraries'
+LIBRARY_FILENAME = 'lib'
+CLIP_PREFIX = 'clip'
+APP_PREFIX = 'app'
+
+# JET events
+JET_EVENT_MARKER = 102
+JET_MARKER_LOOP_END = 0
+JET_EVENT_TRIGGER_CLIP = 103
+
+class JetSegment (object):
+ """ Class to hold segments """
+ def __init__ (self, segname, filename, start=None, end=None, length=None, output=None, quantize=None, jetevents=[], dlsfile=None, dump_file=None, transpose=0, repeat=0, mute_flags=0):
+ self.segname = segname
+ self.filename = filename
+ self.dlsfile = dlsfile
+ self.start = start
+ self.end = end
+ self.length = length
+ self.output = output
+ self.quantize = quantize
+ self.dump_file = dump_file
+ self.jetevents = jetevents
+ #API FIELDS FOR UI
+ self.transpose = transpose
+ self.repeat = repeat
+ self.mute_flags = mute_flags
+
+class JetEvent (object):
+ """ Class to hold events """
+ def __init__(self, event_name, event_type, event_id, track_num, channel_num, event_start, event_end):
+ self.event_name = event_name
+ self.event_type = event_type
+ self.event_id = event_id
+ self.track_num = track_num
+ self.channel_num = channel_num
+ self.event_start = event_start
+ self.event_end = event_end
+
+class JetFileException (Exception):
+ """ Exceptions class """
+ def __init__ (self, msg):
+ self.msg = msg
+ def __str__ (self):
+ return self.msg
+
+class JetSegmentFile (midifile.MIDIFile):
+ def ConvertMusicTimeToTicks (self, s):
+ measures, beats, ticks = s.split(':',3)
+ return self.ConvertToTicks(int(measures), int(beats), int(ticks))
+
+ def ExtractEvents (self, start, end, length, quantize, chase_controllers):
+ if (start is None) and (end is None) and (length is None):
+ logging.debug('ExtractEvents: No change')
+ return
+
+ if start is not None:
+ start = self.ConvertMusicTimeToTicks(start)
+ else:
+ start = 0
+ if end is not None:
+ end = self.ConvertMusicTimeToTicks(end)
+ elif length is not None:
+ length = self.ConvertMusicTimeToTicks(length)
+ end = start + length
+
+ if quantize is not None:
+ quantize = int(quantize)
+ else:
+ quantize = 0
+
+ self.Trim(start, end, quantize, chase_controllers=chase_controllers)
+ #self.DumpTracks()
+
+ def SyncClips (self):
+ """Add controller events to the start of a clip to keep it synced."""
+ values = None
+ last_seq = 0
+ for track in self.tracks:
+ for event in track.events:
+
+ # find start of clip and chase events from last save point
+ if (event.msg_type == midifile.CONTROL_CHANGE) and \
+ (event.controller == JET_EVENT_TRIGGER_CLIP) and \
+ ((event.value & 0x40) == 0x40):
+ logging.debug('Syncing clip at %d ticks' % event.ticks)
+ values = track.events.ChaseControllers(event.seq, last_seq, values)
+
+ #BTH; Seems to fix chase controller bug when multiple clips within segment
+ #last_seq = event.seq
+
+ # generate event list from default values
+ clip_events = values.GenerateEventList(event.ticks)
+
+ #for evt in clip_events:
+ # logging.info(evt)
+
+ track.events.InsertEvents(clip_events, event.seq + 1)
+
+ def AddJetEvents (self, jetevents):
+ for jet_event in jetevents:
+ if jet_event.event_type == JetDefs.E_CLIP:
+ #DumpEvent(jet_event)
+
+ # sanity check
+ if jet_event.track_num >= len(self.tracks):
+ raise JetFileException('Track number %d of out of range for clip' % jet_event.track_num)
+ if jet_event.channel_num > 15:
+ raise JetFileException('Channel number %d of out of range for clip' % jet_event.channel_num)
+ if jet_event.event_id > 63:
+ raise JetFileException('event_id %d of out of range for clip' % jet_event.event_id)
+
+ logging.debug('Adding trigger event for clip %d @ %s and %s' % (jet_event.event_id, jet_event.event_start, jet_event.event_end))
+
+ events = midifile.EventList()
+ events.append(midifile.ControlChangeEvent(
+ self.ConvertMusicTimeToTicks(jet_event.event_start),
+ 0,
+ jet_event.channel_num,
+ JET_EVENT_TRIGGER_CLIP,
+ jet_event.event_id | 0x40))
+
+ events.append(midifile.ControlChangeEvent(
+ self.ConvertMusicTimeToTicks(jet_event.event_end),
+ sys.maxint,
+ jet_event.channel_num,
+ JET_EVENT_TRIGGER_CLIP,
+ jet_event.event_id))
+
+ # merge trigger events
+ self.tracks[jet_event.track_num].events.MergeEvents(events)
+
+ elif jet_event.event_type == JetDefs.E_EOS:
+ if jet_event.track_num >= len(self.tracks):
+ raise JetFileException('Track number %d of out of range for end marker' % jet_event.track_num)
+ if jet_event.channel_num > 15:
+ raise JetFileException('Channel number %d of out of range for end marker' % jet_event.channel_num)
+
+ events = midifile.EventList()
+ logging.debug('Adding end marker at %s' % jet_event.event_start)
+ events.append(midifile.ControlChangeEvent(
+ self.ConvertMusicTimeToTicks(jet_event.event_start),
+ 0,
+ jet_event.channel_num,
+ JET_EVENT_MARKER,
+ JET_MARKER_LOOP_END))
+ self.tracks[jet_event.track_num].events.MergeEvents(events)
+
+ elif jet_event.event_type == JetDefs.E_APP:
+ if jet_event.track_num >= len(self.tracks):
+ raise JetFileException('Track number %d of out of range for app marker' % jet_event.track_num)
+ if jet_event.channel_num > 15:
+ raise JetFileException('Channel number %d of out of range for app marker' % jet_event.channel_num)
+ if jet_event.event_id > 83 or jet_event.event_id < 80:
+ raise JetFileException('EventID %d out of range for application controller' % jet_event.event_id)
+
+ events = midifile.EventList()
+ logging.debug('Adding application controller at %s' % jet_event.event_start)
+ events.append(midifile.ControlChangeEvent(
+ self.ConvertMusicTimeToTicks(jet_event.event_start),
+ 0,
+ jet_event.channel_num,
+ jet_event.event_id,
+ jet_event.event_id))
+ self.tracks[jet_event.track_num].events.MergeEvents(events)
+
+class JetFile (object):
+ """Write a JET file based on a configuration file."""
+ def __init__ (self, config_file, options):
+ self.config_file = config_file
+ self.config = config = ConfigParser.ConfigParser()
+ if self.config_file == "":
+ self.InitializeConfig(JetDefs.UNTITLED_FILE)
+ if not FileExists(self.config_file):
+ self.InitializeConfig(self.config_file)
+
+ config.read(self.config_file)
+ self.ParseConfig(options)
+
+ def DumpConfig (self):
+ """Drump configuration to log file."""
+ # dump configuration
+ config = self.config
+ for section in config.sections():
+ logging.debug('[%s]' % section)
+ for option, value in config.items(section):
+ logging.debug('%s: %s' % (option, value))
+
+ def ParseConfig (self, options):
+ """Validate the configuration."""
+ # check for output name
+ config = self.config
+ if config.has_option(OUTPUT_SECTION, OUTPUT_FILENAME):
+ config.filename = config.get(OUTPUT_SECTION, OUTPUT_FILENAME)
+ else:
+ raise JetFileException('No output filename in configuration file')
+ if config.filename == '' or config.filename == None:
+ config.filename = FileJustRoot(self.config_file) + ".JET"
+ config.chase_controllers = True
+ if config.has_option(OUTPUT_SECTION, OUTPUT_CHASE_CONTROLLERS):
+ try:
+ config.chase_controllers = config.getboolean(OUTPUT_SECTION, OUTPUT_CHASE_CONTROLLERS)
+ except:
+ pass
+
+ config.delete_empty_tracks = False
+ if config.has_option(OUTPUT_SECTION, OUTPUT_OMIT_EMPTY_TRACKS):
+ try:
+ config.delete_empty_tracks = config.getboolean(OUTPUT_SECTION, OUTPUT_OMIT_EMPTY_TRACKS)
+ except:
+ pass
+
+ config.copyright = None
+ if config.has_option(OUTPUT_SECTION, OUTPUT_COPYRIGHT):
+ config.copyright = config.get(OUTPUT_SECTION, OUTPUT_COPYRIGHT)
+
+ config.app_data = None
+ if config.has_option(OUTPUT_SECTION, OUTPUT_APP_DATA):
+ config.app_data = config.get(OUTPUT_SECTION, OUTPUT_APP_DATA)
+
+ # count segments
+ segments = []
+ seg_num = 0
+ while 1:
+
+ # check for segment section
+ segment_name = SEGMENT_SECTION + str(seg_num)
+ if not config.has_section(segment_name):
+ break
+
+ # initialize some parameters
+ start = end = length = output = end_marker = dlsfile = dump_file = None
+ transpose = repeat = mute_flags = 0
+ jetevents = []
+
+ # get the segment parameters
+ segname = config.get(segment_name, SEGMENT_NAME)
+ filename = config.get(segment_name, SEGMENT_FILENAME)
+ if config.has_option(segment_name, SEGMENT_DLSFILE):
+ dlsfile = config.get(segment_name, SEGMENT_DLSFILE)
+ if config.has_option(segment_name, SEGMENT_START):
+ start = config.get(segment_name, SEGMENT_START)
+ if config.has_option(segment_name, SEGMENT_END):
+ end = config.get(segment_name, SEGMENT_END)
+ if config.has_option(segment_name, SEGMENT_LENGTH):
+ length = config.get(segment_name, SEGMENT_LENGTH)
+ if config.has_option(segment_name, SEGMENT_OUTPUT):
+ output = config.get(segment_name, SEGMENT_OUTPUT)
+ if config.has_option(segment_name, SEGMENT_QUANTIZE):
+ quantize = config.get(segment_name, SEGMENT_QUANTIZE)
+ if config.has_option(segment_name, SEGMENT_DUMP_FILE):
+ dump_file = config.get(segment_name, SEGMENT_DUMP_FILE)
+ #API FIELDS
+ if config.has_option(segment_name, SEGMENT_TRANSPOSE):
+ transpose = config.get(segment_name, SEGMENT_TRANSPOSE)
+ if config.has_option(segment_name, SEGMENT_REPEAT):
+ repeat = config.get(segment_name, SEGMENT_REPEAT)
+ if config.has_option(segment_name, SEGMENT_MUTE_FLAGS):
+ mute_flags = config.get(segment_name, SEGMENT_MUTE_FLAGS)
+
+ if config.has_option(segment_name, SEGMENT_END_MARKER):
+ end_marker = config.get(segment_name, SEGMENT_END_MARKER)
+ track_num, channel_num, event_time = end_marker.split(',',2)
+ #jetevents.append((JetDefs.E_EOS, 0, int(track_num), int(channel_num), event_time, ''))
+ jetevents.append(JetEvent(JetDefs.E_EOS, JetDefs.E_EOS, 0, int(track_num), int(channel_num), event_time, event_time))
+
+ # check for jetevents
+ for jetevent, location in config.items(segment_name):
+ if jetevent.startswith(CLIP_PREFIX):
+ event_name, event_id, track_num, channel_num, event_start, event_end = location.split(',', 5)
+ jetevents.append(JetEvent(event_name, JetDefs.E_CLIP, int(event_id), int(track_num), int(channel_num), event_start, event_end))
+
+ # check for appevents
+ for jetevent, location in config.items(segment_name):
+ if jetevent.startswith(APP_PREFIX):
+ event_name, event_id, track_num, channel_num, event_start, event_end = location.split(',', 5)
+ jetevents.append(JetEvent(event_name, JetDefs.E_APP, int(event_id), int(track_num), int(channel_num), event_start, event_end))
+
+ segments.append(JetSegment(segname, filename, start, end, length, output, quantize, jetevents, dlsfile, dump_file, int(transpose), int(repeat), int(mute_flags)))
+ seg_num += 1
+
+ self.segments = segments
+ if not len(segments):
+ #TODO: Check for segments when writing
+ #raise JetFileException('No segments defined in configuration file')
+ pass
+
+ # count libraries
+ libraries = []
+ lib_num = 0
+ while 1:
+ library_name = LIBRARY_FILENAME + str(lib_num)
+ if not config.has_option(LIBRARY_SECTION, library_name):
+ break
+ libraries.append(config.get(LIBRARY_SECTION, library_name))
+ lib_num += 1
+ self.libraries = libraries
+
+ def WriteJetFileFromConfig (self, options):
+ """Write JET file from config file."""
+
+ # open the output file and write the header
+ output_file = open(self.config.filename, 'wb')
+ jet_header = struct.pack(JET_HEADER_STRUCT, JET_HEADER_TAG, 0)
+ output_file.write(jet_header)
+
+ # write the JINF chunk
+ jet_info = struct.pack(JINF_STRUCT,
+ JET_INFO_CHUNK, struct.calcsize(JINF_STRUCT) - 8,
+ JINF_JET_VERSION, JET_VERSION,
+ JINF_NUM_SMF_CHUNKS, len(self.segments),
+ JINF_NUM_DLS_CHUNKS, len(self.libraries))
+ output_file.write(jet_info)
+
+ # write the JCOP chunk (if any)
+ if self.config.copyright is not None:
+ size = len(self.config.copyright) + 1
+ if size & 1:
+ size += 1
+ extra_byte = True
+ else:
+ extra_byte = False
+ jet_copyright = struct.pack(JCOP_STRUCT, JCOP_CHUNK, size)
+ output_file.write(jet_copyright)
+ output_file.write(self.config.copyright)
+ output_file.write(chr(0))
+ if extra_byte:
+ output_file.write(chr(0))
+
+ # write the app data chunk (if any)
+ if self.config.app_data is not None:
+ size = os.path.getsize(self.config.app_data)
+ if size & 1:
+ size += 1
+ extra_byte = True
+ else:
+ extra_byte = False
+ jet_app_data = struct.pack(JAPP_STRUCT, JAPP_CHUNK, size)
+ output_file.write(jet_app_data)
+ with open(self.config.app_data, 'rb') as f:
+ output_file.write(f.read())
+ if extra_byte:
+ output_file.write(chr(0))
+
+ # copy the MIDI segments
+ seg_num = 0
+ for segment in self.segments:
+ logging.debug('Writing segment %d' % seg_num)
+
+ # open SMF file and read it
+ jet_segfile = JetSegmentFile(segment.filename, 'rb')
+ jet_segfile.ReadFromStream()
+
+ # insert events
+ jet_segfile.AddJetEvents(segment.jetevents)
+
+ # trim to length specified in config file
+ jet_segfile.ExtractEvents(segment.start, segment.end, segment.length, segment.quantize, self.config.chase_controllers)
+
+ # chase controller events and fix them
+ if self.config.chase_controllers:
+ jet_segfile.SyncClips()
+
+ # delete empty tracks
+ if self.config.delete_empty_tracks:
+ jet_segfile.DeleteEmptyTracks()
+
+ # write separate output file if requested
+ if segment.output is not None:
+ jet_segfile.SaveAs(segment.output)
+
+ # write dump file
+ if segment.dump_file is not None:
+ with open(segment.dump_file, 'w') as f:
+ jet_segfile.DumpTracks(f)
+
+ # write the segment header
+ header_pos = output_file.tell()
+ smf_header = struct.pack(JET_HEADER_STRUCT, JET_SMF_CHUNK, 0)
+ output_file.write(smf_header)
+ start_pos = output_file.tell()
+
+ # write SMF file to output file
+ jet_segfile.Write(output_file, offset=start_pos)
+ jet_segfile.close()
+
+ # return to segment header and write actual size
+ end_pos = output_file.tell()
+ file_size = end_pos - start_pos
+ if file_size & 1:
+ file_size += 1
+ end_pos += 1
+ output_file.seek(header_pos, 0)
+ smf_header = struct.pack(JET_HEADER_STRUCT, JET_SMF_CHUNK, file_size)
+ output_file.write(smf_header)
+ output_file.seek(end_pos, 0)
+
+ seg_num += 1
+
+ # copy the DLS segments
+ for library in self.libraries:
+ if FileExists(library):
+ # open SMF file and get size
+ lib_file = (open(library,'rb'))
+ lib_file.seek(0,2)
+ file_size = lib_file.tell()
+ lib_file.seek(0)
+
+ # write the library header
+ dls_header = struct.pack(JET_HEADER_STRUCT, JET_DLS_CHUNK, file_size)
+ output_file.write(dls_header)
+
+ # copy DLS file to output file
+ output_file.write(lib_file.read())
+ lib_file.close()
+
+ # write the header with the read data size
+ file_size = output_file.tell()
+ output_file.seek(0)
+ jet_header = struct.pack(JET_HEADER_STRUCT, JET_HEADER_TAG, file_size - struct.calcsize(JET_HEADER_STRUCT))
+ output_file.write(jet_header)
+ output_file.close()
+
+ def GetMidiFiles(self):
+ """ Gets a list of midifiles """
+ midiFiles = []
+ for segment in self.segments:
+ if segment.filename not in midiFiles:
+ midiFiles.append(segment.filename)
+ return midiFiles
+
+ def GetLibraries(self):
+ """ Gets the libraries """
+ return self.libraries
+
+ def GetEvents(self, segName):
+ """ Gets the events for a segment """
+ for segment in self.segments:
+ if segment.segname == segName:
+ return segment.jetevents
+ return None
+
+ def GetEvent(self, segName, eventName):
+ """ Gets a single event from a segment """
+ for segment in self.segments:
+ if segment.segname == segName:
+ for event in segment.jetevents:
+ if event.event_name == eventName:
+ return event
+ return None
+
+ def AddEvent(self, segname, event_name, event_type, event_id, track_num, channel_num, event_start, event_end):
+ """ Adds an event """
+ for segment in self.segments:
+ if segment.segname == segname:
+ segment.jetevents.append(JetEvent(event_name, event_type, int(event_id), int(track_num), int(channel_num), event_start, event_end))
+
+ def ReplaceEvents(self, segname, newEvents):
+ """ Replaces all events """
+ for segment in self.segments:
+ if segment.segname == segname:
+ segment.jetevents = newEvents
+ return segment
+
+ def UpdateEvent(self, segname, orgeventname, event_name, event_type, event_id, track_num, channel_num, event_start, event_end):
+ """ Updates an event """
+ for segment in self.segments:
+ if segment.segname == segname:
+ for jetevent in segment.jetevents:
+ if jetevent.event_name == orgeventname:
+ jetevent.event_name = event_name
+ jetevent.event_type = event_type
+ jetevent.event_id = event_id
+ jetevent.track_num = track_num
+ jetevent.channel_num = channel_num
+ jetevent.event_start = event_start
+ jetevent.event_end = event_end
+
+ def DeleteSegmentsMatchingPrefix(self, prefix):
+ """ Deletes all segments matching name """
+ iOnce = True
+ iAgain = False
+ while(iOnce or iAgain):
+ iOnce = False
+ iAgain = False
+ for segment in self.segments:
+ if segment.segname[0:len(prefix)].upper() == prefix.upper():
+ self.segments.remove(segment)
+ iAgain = True
+
+ def DeleteEvent(self, segname, event_name):
+ """ Deletes an event """
+ for segment in self.segments:
+ if segment.segname == segname:
+ for jetevent in segment.jetevents:
+ if jetevent.event_name == event_name:
+ segment.jetevents.remove(jetevent)
+
+ def DeleteEventsMatchingPrefix(self, segname, prefix):
+ """ Deletes all events matching name """
+ for segment in self.segments:
+ if segment.segname == segname:
+ iOnce = True
+ iAgain = False
+ while(iOnce or iAgain):
+ iOnce = False
+ iAgain = False
+ for jetevent in segment.jetevents:
+ if jetevent.event_name[0:len(prefix)].upper() == prefix.upper():
+ segment.jetevents.remove(jetevent)
+ iAgain = True
+
+ def MoveEvent(self, segname, movename, event_start, event_end):
+ """ Move an event """
+ for segment in self.segments:
+ if segment.segname == segname:
+ for jetevent in segment.jetevents:
+ if jetevent.event_name == movename:
+ jetevent.event_start = event_start
+ jetevent.event_end = event_end
+ return
+
+ def GetSegments(self):
+ """ Gets all segments """
+ return self.segments
+
+ def GetSegment(self, segName):
+ """ Gets one segment by name """
+ for segment in self.segments:
+ if segment.segname == segName:
+ return segment
+ return None
+
+ def AddSegment(self, segname, filename, start, end, length, output, quantize, jetevents, dlsfile, dump_file, transpose, repeat, mute_flags):
+ """ Adds a segment """
+ if length == JetDefs.MBT_ZEROSTR:
+ length = None
+ if end == JetDefs.MBT_ZEROSTR:
+ end = None
+ self.segments.append(JetSegment(segname, filename, start, end, length, output, quantize, jetevents, dlsfile, dump_file, transpose, repeat, mute_flags))
+
+ def UpdateSegment(self, orgsegname, segname, filename, start, end, length, output, quantize, jetevents, dlsfile, dump_file, transpose, repeat, mute_flags):
+ """ Updates a segment """
+ if length == JetDefs.MBT_ZEROSTR:
+ length = None
+ if end == JetDefs.MBT_ZEROSTR:
+ end = None
+ for segment in self.segments:
+ if segment.segname == orgsegname:
+ segment.segname = segname
+ segment.filename = filename
+ segment.start = start
+ segment.end = end
+ segment.length = length
+ segment.output = output
+ segment.quantize = quantize
+ segment.dlsfile = dlsfile
+ segment.transpose = transpose
+ segment.repeat = repeat
+ segment.mute_flags = mute_flags
+
+ def MoveSegment(self, segname, start, end):
+ """ Moves a segment """
+ for segment in self.segments:
+ if segment.segname == segname:
+ segment.start = start
+ segment.end = end
+ return
+
+ def DeleteSegment(self, segname):
+ """ Deletes a segment """
+ for segment in self.segments:
+ if segment.segname == segname:
+ self.segments.remove(segment)
+
+ def SaveJetConfig(self, configFile):
+ """ Saves the jet config file """
+ if self.config.filename == '' or self.config.filename == None:
+ self.config.filename = FileJustRoot(configFile) + ".JET"
+ config = ConfigParser.ConfigParser()
+ config.add_section(OUTPUT_SECTION)
+ config.set(OUTPUT_SECTION, OUTPUT_FILENAME, self.config.filename)
+ config.set(OUTPUT_SECTION, OUTPUT_CHASE_CONTROLLERS, self.config.chase_controllers)
+ config.set(OUTPUT_SECTION, OUTPUT_OMIT_EMPTY_TRACKS, self.config.delete_empty_tracks)
+ if self.config.copyright is not None:
+ config.set(OUTPUT_SECTION, OUTPUT_COPYRIGHT, self.config.copyright)
+ if self.config.app_data is not None:
+ config.set(OUTPUT_SECTION, OUTPUT_APP_DATA, self.config.app_data)
+
+ self.libraries = []
+ seg_num = 0
+ for segment in self.segments:
+ segment_name = SEGMENT_SECTION + str(seg_num)
+ config.add_section(segment_name)
+ config.set(segment_name, SEGMENT_NAME, segment.segname)
+ config.set(segment_name, SEGMENT_FILENAME, segment.filename)
+
+ config.set(segment_name, SEGMENT_DLSFILE, segment.dlsfile)
+ if FileExists(segment.dlsfile):
+ if not segment.dlsfile in self.libraries:
+ self.libraries.append(segment.dlsfile)
+ config.set(segment_name, SEGMENT_START, segment.start)
+ if segment.end > JetDefs.MBT_ZEROSTR and len(segment.end) > 0:
+ config.set(segment_name, SEGMENT_END, segment.end)
+ if segment.length > JetDefs.MBT_ZEROSTR and len(segment.length) > 0:
+ config.set(segment_name, SEGMENT_LENGTH, segment.length)
+ config.set(segment_name, SEGMENT_OUTPUT, segment.output)
+ config.set(segment_name, SEGMENT_QUANTIZE, segment.quantize)
+ if segment.dump_file is not None:
+ config.set(segment_name, SEGMENT_DUMP_FILE, segment.dump_file)
+ config.set(segment_name, SEGMENT_TRANSPOSE, segment.transpose)
+ config.set(segment_name, SEGMENT_REPEAT, segment.repeat)
+ config.set(segment_name, SEGMENT_MUTE_FLAGS, segment.mute_flags)
+
+ clip_num = 0
+ app_num = 0
+ for jet_event in segment.jetevents:
+ if jet_event.event_type == JetDefs.E_CLIP:
+ clip_name = CLIP_PREFIX + str(clip_num)
+ s = "%s,%s,%s,%s,%s,%s" % (jet_event.event_name, jet_event.event_id, jet_event.track_num, jet_event.channel_num, jet_event.event_start, jet_event.event_end)
+ config.set(segment_name, clip_name, s)
+ clip_num += 1
+ elif jet_event.event_type == JetDefs.E_APP:
+ app_name = APP_PREFIX + str(app_num)
+ s = "%s,%s,%s,%s,%s,%s" % (jet_event.event_name, jet_event.event_id, jet_event.track_num, jet_event.channel_num, jet_event.event_start, jet_event.event_end)
+ config.set(segment_name, app_name, s)
+ app_num += 1
+ elif jet_event.event_type == JetDefs.E_EOS:
+ s = "%s,%s,%s" % (jet_event.track_num, jet_event.channel_num, jet_event.event_start)
+ config.set(segment_name, SEGMENT_END_MARKER, s)
+
+ seg_num += 1
+
+ lib_num = 0
+ config.add_section(LIBRARY_SECTION)
+ for library in self.libraries:
+ library_name = LIBRARY_FILENAME + str(lib_num)
+ config.set(LIBRARY_SECTION, library_name, library)
+ lib_num += 1
+
+ FileKillClean(configFile)
+ cfgfile = open(configFile,'w')
+ config.write(cfgfile)
+ cfgfile.close()
+
+ def InitializeConfig(self, configFile):
+ """ Initializes the values for an empty flag """
+ self.config.filename = FileJustRoot(configFile) + ".JET"
+ self.config.chase_controllers = True
+ self.config.delete_empty_tracks = False
+ self.config.copyright = None
+ self.config.app_data = None
+ self.segments = []
+ self.libraries = []
+ self.config_file = configFile
+ self.SaveJetConfig(configFile)
+
+
+
+#---------------------------------------------------------------
+# main
+#---------------------------------------------------------------
+if __name__ == '__main__':
+ sys = __import__('sys')
+ optparse = __import__('optparse')
+
+ # parse command line options
+ parser = optparse.OptionParser(version=VERSION)
+ parser.set_defaults(log_level=logging.INFO, log_file=None)
+ parser.add_option('-d', '--debug', action="store_const", const=logging.DEBUG, dest='log_level', help='Enable debug output')
+ parser.add_option('-l', '--log_file', dest='log_file', help='Write debug output to log file')
+ (options, args) = parser.parse_args()
+
+ # get master logger
+ logger = logging.getLogger('')
+ logger.setLevel(options.log_level)
+
+ # create console logger
+ console_logger = logging.StreamHandler()
+ console_logger.setFormatter(logging.Formatter('%(message)s'))
+ logger.addHandler(console_logger)
+
+ # create rotating file logger
+ if options.log_file is not None:
+ file_logger = logging.FileHandler(options.log_file, 'w')
+ file_logger.setFormatter(logging.Formatter('%(message)s'))
+ logger.addHandler(file_logger)
+
+ # process files
+ for arg in args:
+ print arg
+ jet_file = JetFile(arg, options)
+ jet_file.WriteJetFileFromConfig(options)
+
diff --git a/jet_tools/JetCreator/JetHelp.py b/jet_tools/JetCreator/JetHelp.py
new file mode 100755
index 0000000..1606a2a
--- /dev/null
+++ b/jet_tools/JetCreator/JetHelp.py
@@ -0,0 +1,33 @@
+"""
+ File:
+ JetHelp.py
+
+ Contents and purpose:
+ Displays the help text
+
+ Copyright (c) 2008 Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+"""
+
+import wx
+import wx.html
+from JetDefs import *
+
+app = wx.PySimpleApp()
+frame = wx.Frame(None, -1, JetDefs.MAIN_HELPTITLE, size=(800,600))
+html1 = wx.html.HtmlWindow(frame, -1)
+html1.LoadPage(JetDefs.MAIN_HELPFILE)
+frame.Center()
+frame.Show()
+app.MainLoop()
diff --git a/jet_tools/JetCreator/JetPreview.py b/jet_tools/JetCreator/JetPreview.py
new file mode 100755
index 0000000..34c16d3
--- /dev/null
+++ b/jet_tools/JetCreator/JetPreview.py
@@ -0,0 +1,200 @@
+"""
+ File:
+ JetPreview.py
+
+ Contents and purpose:
+ Plays the preview of a segment or event via the dialog box
+
+ Copyright (c) 2008 Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+"""
+
+from __future__ import with_statement
+
+import wx
+import threading
+
+from JetDefs import *
+from JetCtrls import *
+from JetFile import *
+from JetUtils import *
+from eas import *
+from JetStatusEvent import *
+
+class PreviewPlayer(wx.Frame):
+ """ Segment player """
+ def __init__ (self, play_button, segment):
+ self.segment = segment
+ self.play_button = play_button
+ self.mute_button = None
+ self.trigger_button = None
+ self.playerLock = threading.RLock()
+ self.SetKeepPlayingFlag(False)
+ self.graph = None
+
+ def SetGraphCtrl(self, graph, parentWin):
+ """ Sets the graph control for the player """
+ self.graph = graph
+ self.parentWin = parentWin
+
+ def SetGraphCallbackFct(self, ClickCallbackFct):
+ """ Sets the callback function for the graph control to update """
+ self.ClickCallbackFct = ClickCallbackFct
+
+ def GraphTriggerClip(self, sClipName, iEventId):
+ """ Triggers a clip by clicking on it """
+ with self.playerLock:
+ try:
+ self.jet.TriggerClip(iEventId)
+ return True
+ except:
+ return False
+
+ def SetMuteFlag(self, trackNum, mute):
+ """ Sets a mute flag """
+ sync = JetDefs.DEFAULT_MUTE_SYNC
+ with self.playerLock:
+ try:
+ self.jet.SetMuteFlag(trackNum, mute, sync)
+ logging.info("SetMuteFlag() Track:%d Mute:%d Sync:%d" % (trackNum, mute, sync))
+ return True
+ except:
+ return False
+
+ def TriggerClip(self, eventID):
+ """ Triggers a clip via function """
+ with self.playerLock:
+ try:
+ self.jet.TriggerClip(eventID)
+ logging.info("TriggerClip() eventID: %d" % eventID)
+ return True
+ except:
+ return False
+
+ def MuteTrackViaButton(self, button, trackNum):
+ """ Mutes a track via a button """
+ with self.playerLock:
+ self.mute_button = button
+ if button.GetLabel() == JetDefs.BUT_MUTE:
+ if self.SetMuteFlag(trackNum, True):
+ button.SetLabel(JetDefs.BUT_UNMUTE)
+ else:
+ if self.SetMuteFlag(trackNum, False):
+ button.SetLabel(JetDefs.BUT_MUTE)
+
+ def Start(self):
+ """ Starts the playback. Called as a thread from dialog boxes """
+ self.paused = False
+
+ wx.PostEvent(self.parentWin, JetStatusEvent(JetDefs.PST_PLAY, None))
+
+ # create a temporary config file, and jet output file
+ FileKillClean(JetDefs.TEMP_JET_CONFIG_FILE)
+
+ self.jet_file = JetFile(JetDefs.TEMP_JET_CONFIG_FILE, "")
+
+ self.jet_file.AddSegment(self.segment.segname,
+ self.segment.filename,
+ self.segment.start,
+ self.segment.end,
+ self.segment.length,
+ SegmentOutputFile(self.segment.segname, JetDefs.TEMP_JET_CONFIG_FILE),
+ self.segment.quantize,
+ self.segment.jetevents,
+ self.segment.dlsfile,
+ None,
+ self.segment.transpose,
+ self.segment.repeat,
+ self.segment.mute_flags)
+ userID = 0
+ dls_num = -1
+ seg_num = 0
+
+ if len(self.segment.dlsfile) > 0:
+ self.jet_file.libraries.append(self.segment.dlsfile)
+ dls_num = 0
+
+ self.jet_file.SaveJetConfig(JetDefs.TEMP_JET_CONFIG_FILE)
+ self.jet_file.WriteJetFileFromConfig(JetDefs.TEMP_JET_CONFIG_FILE)
+
+ if not ValidateConfig(self.jet_file):
+ return
+
+ self.queueSegs = []
+ self.queueSegs.append(QueueSeg(self.segment.segname, userID, seg_num, dls_num, self.segment.repeat, self.segment.transpose, self.segment.mute_flags))
+
+ self.jet = JET()
+ self.jet.eas.StartWave()
+ self.jet.OpenFile(self.jet_file.config.filename)
+
+ # queue first segment and start playback
+ index = 0
+ Queue(self.jet, self.queueSegs[index])
+
+ index += 1
+ self.jet.Play()
+
+ self.SetKeepPlayingFlag(True)
+ while self.GetKeepPlayingFlag():
+ self.jet.Render()
+ status = self.jet.Status()
+
+ # if no more segments - we're done
+ if status.numQueuedSegments == 0:
+ break
+
+ self.jet.GetAppEvent()
+
+ # if less than 2 segs queued - queue another one
+ if (index < len(self.queueSegs)) and (status.numQueuedSegments < 2):
+ Queue(self.jet, self.queueSegs[index])
+ index += 1
+
+ wx.PostEvent(self.parentWin, JetStatusEvent(JetDefs.PST_UPD_LOCATION, status.location))
+
+ SafeJetShutdown(self.playerLock, self.jet)
+
+ FileKillClean(SegmentOutputFile(self.segment.segname, JetDefs.TEMP_JET_CONFIG_FILE))
+ FileKillClean(JetDefs.TEMP_JET_CONFIG_FILE)
+ FileKillClean(self.jet_file.config.filename)
+
+ self.SetKeepPlayingFlag(False)
+
+ wx.PostEvent(self.parentWin, JetStatusEvent(JetDefs.PST_DONE, None))
+
+ wx.PostEvent(self.parentWin, JetStatusEvent(JetDefs.PST_UPD_LOCATION, 0))
+
+ def SetKeepPlayingFlag(self, val):
+ """ Sets the flag to tell us wheter to keep playing """
+ with self.playerLock:
+ self.keepPlaying = val
+
+ def GetKeepPlayingFlag(self):
+ """ Gets the keep playing flag """
+ with self.playerLock:
+ return self.keepPlaying
+
+ def Pause(self):
+ """ Pauses playback """
+ if self.jet is None:
+ return
+ if not self.paused:
+ self.jet.Pause()
+ self.paused = True
+ wx.PostEvent(self.parentWin, JetStatusEvent(JetDefs.PST_PAUSE, None))
+ else:
+ self.jet.Play()
+ self.paused = False
+ wx.PostEvent(self.parentWin, JetStatusEvent(JetDefs.PST_RESUME, None))
+
diff --git a/jet_tools/JetCreator/JetSegGraph.py b/jet_tools/JetCreator/JetSegGraph.py
new file mode 100755
index 0000000..04d4ca3
--- /dev/null
+++ b/jet_tools/JetCreator/JetSegGraph.py
@@ -0,0 +1,361 @@
+"""
+ File:
+ JetSegGraph.py
+
+ Contents and purpose:
+ Draws the event graph and progress bar
+
+ Copyright (c) 2008 Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+"""
+
+
+import wx
+import logging
+
+from JetUtils import *
+from JetDefs import *
+
+GRAPH_COLORS = [
+ '#C0E272',
+ '#85CF89',
+ '#CF9683',
+ '#749EDE',
+ '#9FB5B1',
+ '#B095BF',
+ '#FE546D',
+ '#B3BB97',
+ '#FFFFB8',
+
+ ]
+
+PROGRESS_BAR = '#0000CC'
+EOS_BAR = '#095000'
+APP_BAR = '#B3BB97'
+
+
+class Marker():
+ """ Defines portions of the graph for events """
+ def __init__(self, sEventType, iEventId, sName, sStartMbt, sEndMbt, iStartMeasure, ppqn):
+ self.sEventType = sEventType
+ self.iEventId = iEventId
+ self.sName = sName
+ self.StartMbt = ConvertStrTimeToTuple(sStartMbt)
+ self.EndMbt = ConvertStrTimeToTuple(sEndMbt)
+ self.iStartMeasure = iStartMeasure
+ self.iStart = 0
+ self.iEnd = 0
+ self.iWidth = 0
+ self.iHeight = 0
+ self.iTop = 0
+ self.iUpdate = False
+ self.sColor = '#FFFFB8'
+ self.ppqn = ppqn
+ self.isDirty = False
+
+ def CalcCoord(self, step, height, ColorFct):
+ """ Calculates the coordinates in pixels for graphing the shaded regions """
+ #measures
+ iStartM = self.StartMbt[0] - self.iStartMeasure
+ iEndM = self.EndMbt[0] - self.iStartMeasure
+ self.iStart = step * iStartM
+ self.iEnd = step * iEndM
+ #beats
+ self.iStart = self.iStart + ((step / 4.0) * (self.StartMbt[1]-1))
+ self.iEnd = self.iEnd + ((step / 4.0) * (self.EndMbt[1]-1))
+ #ticks
+ pctTickOfBeat = (float(self.StartMbt[2]) / float(self.ppqn))
+ self.iStart = self.iStart + ((pctTickOfBeat * (step / 4.0)))
+ pctTickOfBeat = (float(self.EndMbt[2]) / float(self.ppqn))
+ self.iEnd = self.iEnd + ((pctTickOfBeat * (step / 4.0)))
+
+ self.iWidth = self.iEnd - self.iStart
+
+ self.iHeight = height
+ self.sColor = ColorFct()
+ self.iUpdate = False
+
+class SegmentGraph(wx.Panel):
+ """ Draws the player graph bar """
+ def __init__(self, parent, pos=wx.DefaultPosition, size=wx.DefaultSize, ClickCallbackFct=None, showLabels=True, showClips=True, showAppEvts=True):
+ wx.Panel.__init__(self, parent, -1, pos=pos, size=size, style=wx.BORDER_STATIC)
+ self.iLocationInMs = 0
+ self.iLengthInMs = 0
+ self.iLengthInMeasures = 0
+ self.iMarkerTop = 15
+ self.iScaleTop = 0
+ self.iEdges = 5
+ self.iStartMeasure = 0
+ self.iMidiMode = False
+ self.ClickCallbackFct = ClickCallbackFct
+ self.iColor = 0
+ self.showLabels = showLabels
+ self.showClips = showClips
+ self.showAppEvts = showAppEvts
+
+ self.font = wx.Font(8, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, 'Courier')
+
+ self.Markers = []
+ self.SetBackgroundStyle(wx.BG_STYLE_CUSTOM)
+ self.Bind(wx.EVT_PAINT, self.OnPaint)
+ self.Bind(wx.EVT_SIZE, self.OnSize)
+ self.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown)
+
+ #initialize buffer
+ self.OnSize(None)
+
+ def ClearGraph(self):
+ """ Clears the graph values """
+ self.iLocationInMs = 0
+ self.iLengthInMs = 0
+ self.iLengthInMeasures = 0
+ self.iMarkerTop = 15
+ self.iScaleTop = 0
+ self.iEdges = 5
+ self.iStartMeasure = 0
+ self.iMidiMode = False
+ self.iColor = 0
+ self.Markers = []
+ self.iLocationInMs = 0
+ self.DoDrawing()
+
+ def LoadSegment(self, segment, segMarker=None, iMidiMode=False, showLabels=True, showClips=True, showAppEvts=True):
+ """ Loads up the segment drawing the graph """
+ if segment is None:
+ self.ClearGraph()
+ return None
+ self.iMidiMode = iMidiMode
+ self.showLabels = showLabels
+ self.showClips = showClips
+ self.showAppEvts = showAppEvts
+ self.Markers = []
+ self.iLocationInMs = 0
+ info = MidiSegInfo(segment)
+ #disable graph for debugging
+ #return info
+ self.iLengthInMs = info.iLengthInMs
+ self.ppqn = info.ppqn
+ self.StartMbt = mbtFct(ConvertStrTimeToTuple(segment.start), 1)
+ self.EndMbt = mbtFct(ConvertStrTimeToTuple(segment.end), 1)
+ self.LengthMbt = None
+ self.iStartMeasure = self.StartMbt[0]
+ self.iLengthInMeasures = self.EndMbt[0] - self.StartMbt[0]
+
+ for jet_event in segment.jetevents:
+ if self.showClips and jet_event.event_type == JetDefs.E_CLIP:
+ self.AddMarker(JetDefs.E_CLIP, jet_event.event_id, jet_event.event_name, mbtFct(jet_event.event_start,1), mbtFct(jet_event.event_end,1), self.iStartMeasure, self.ppqn)
+ elif jet_event.event_type == JetDefs.E_EOS:
+ self.AddMarker(JetDefs.E_EOS, jet_event.event_id, jet_event.event_name, mbtFct(jet_event.event_end,1), mbtFct(jet_event.event_end,1), self.iStartMeasure, self.ppqn)
+ elif self.showAppEvts and jet_event.event_type == JetDefs.E_APP:
+ self.AddMarker(JetDefs.E_APP, jet_event.event_id, jet_event.event_name, mbtFct(jet_event.event_start,1), mbtFct(jet_event.event_end,1), self.iStartMeasure, self.ppqn)
+
+ if segMarker is not None:
+ self.AddMarker(JetDefs.E_CLIP, 0, segMarker[0], mbtFct(segMarker[1],1), mbtFct(segMarker[2],1), self.iStartMeasure, self.ppqn)
+
+ self.DoDrawing()
+ return info
+
+ def AddMarker(self, sEventType, iEventId, sName, sStartMbt, sEndMbt, iStartMeasure, ppqn):
+ """ Adds a marker to the list """
+ if not CompareMbt(sStartMbt, sEndMbt):
+ sEndMbt = sStartMbt
+ self.Markers.append(Marker(sEventType, iEventId, sName, sStartMbt, sEndMbt, iStartMeasure, ppqn))
+
+ def OnLeftDown(self, event):
+ """ Calls the function assicated with an event """
+ pt = event.GetPosition()
+ for Marker in self.Markers:
+ if pt[0] >= Marker.iStart and pt[0] <= Marker.iEnd and pt[1] >= Marker.iTop and pt[1] <= Marker.iTop + Marker.iHeight:
+ if self.ClickCallbackFct != None:
+ self.ClickCallbackFct(Marker.sName, Marker.iEventId)
+
+ def GetAColor(self):
+ """ Gets a color """
+ color = GRAPH_COLORS[self.iColor]
+ self.iColor = self.iColor + 1
+ if self.iColor >= len(GRAPH_COLORS):
+ self.iColor = 0
+ return color
+
+ def OnSize(self, event=None):
+ """ Repaints for resizing of screen """
+ if OsWindows():
+ # The Buffer init is done here, to make sure the buffer is always
+ # the same size as the Window
+ Size = self.GetClientSizeTuple()
+
+ # Make new offscreen bitmap: this bitmap will always have the
+ # current drawing in it, so it can be used to save the image to
+ # a file, or whatever.
+ self._Buffer = wx.EmptyBitmap(*Size)
+ self.DoDrawing(None)
+ if event is not None:
+ event.Skip()
+
+ def OnPaint(self, event=None):
+ """ Painting of windows """
+ if OsWindows():
+ dc = wx.BufferedPaintDC(self, self._Buffer)
+ else:
+ dc = wx.AutoBufferedPaintDC(self)
+ dc.Background = wx.Brush(wx.WHITE)
+ self.DoDrawing(dc)
+
+ def DoDrawing(self, dc=None):
+ """ Does the actual drawing of the control """
+ if dc is None:
+ if OsWindows():
+ dc = wx.BufferedDC(wx.ClientDC(self), self._Buffer)
+ else:
+ dc = wx.AutoBufferedPaintDC(self)
+ dc.Background = wx.Brush(wx.WHITE)
+
+ dc.Clear()
+
+ self.iColor = 0
+ gWidth, gHeight = self.GetSize()
+ gWidth = gWidth - (self.iEdges * 2)
+ step = int(gWidth / (self.iLengthInMeasures + .01))
+
+ for Marker in self.Markers:
+ Marker.CalcCoord(step, gHeight, self.GetAColor)
+
+ """ eliminate overlaps; establish colors """
+ iClips = 0
+ iMarkers = 0
+ for index, Marker in enumerate(self.Markers):
+ if Marker.sEventType == JetDefs.E_CLIP:
+ iClips = iClips + 1
+ iOverlaps = 1
+ for index1, Marker1 in enumerate(self.Markers):
+ if Marker.sEventType == JetDefs.E_CLIP:
+ if index != index1 and not Marker1.iUpdate:
+ if Marker.iStart <= Marker1.iStart and Marker.iEnd <= Marker1.iEnd and Marker.iEnd >= Marker1.iStart:
+ iOverlaps = iOverlaps + 1
+ Marker.iUpdate = True
+ Marker1.iUpdate = True
+ if not Marker.iUpdate and Marker.iStart >= Marker1.iStart and Marker.iEnd >= Marker1.iEnd and Marker.iStart <= Marker1.iEnd:
+ iOverlaps = iOverlaps + 1
+ Marker.iUpdate = True
+ Marker1.iUpdate = True
+ if iOverlaps > 1:
+ iTop = 0
+ for index1, Marker1 in enumerate(self.Markers):
+ if Marker.sEventType == JetDefs.E_CLIP:
+ if Marker1.iUpdate:
+ Marker1.iHeight = gHeight / iOverlaps
+ Marker1.iTop = iTop * Marker1.iHeight
+ iTop = iTop + 1
+ elif Marker.sEventType == JetDefs.E_APP:
+ iMarkers = iMarkers + 1
+
+ for Marker in self.Markers:
+ if Marker.sEventType == JetDefs.E_CLIP:
+ dc.SetPen(wx.Pen(Marker.sColor))
+ dc.SetBrush(wx.Brush(Marker.sColor))
+ dc.DrawRectangle(Marker.iStart + self.iEdges, Marker.iTop, Marker.iWidth, Marker.iHeight)
+ width, height = dc.GetTextExtent(Marker.sName)
+ k = ((Marker.iStart + Marker.iEnd) / 2) - (width/2) + self.iEdges
+ if self.showLabels or self.iMidiMode:
+ dc.DrawText(Marker.sName, k, ((Marker.iTop+Marker.iHeight/2) - (height*.5)))
+ if self.iMidiMode:
+ self.iMidiModeStart = Marker.iStart
+ elif Marker.sEventType == JetDefs.E_EOS:
+ dc.SetPen(wx.Pen(EOS_BAR))
+ dc.SetBrush(wx.Brush(EOS_BAR))
+ dc.DrawRectangle(Marker.iStart + self.iEdges, Marker.iTop, 1, Marker.iHeight)
+ width, height = dc.GetTextExtent(Marker.sName)
+ k = Marker.iStart - (width/2) + self.iEdges
+ dc.DrawText(Marker.sName, k, ((Marker.iTop+Marker.iHeight/2) - (height*.5)))
+ elif Marker.sEventType == JetDefs.E_APP:
+ dc.SetPen(wx.Pen(APP_BAR))
+ dc.SetBrush(wx.Brush(APP_BAR))
+ dc.DrawRectangle(Marker.iStart + self.iEdges, Marker.iTop, 1, Marker.iHeight)
+ width, height = dc.GetTextExtent(Marker.sName)
+ k = Marker.iStart - (width/2) + self.iEdges
+ if self.showLabels or self.iMidiMode:
+ dc.DrawText(Marker.sName, k, ((Marker.iTop+Marker.iHeight/2) - (height*.5)))
+
+
+ """ Draw scale """
+ if gWidth == 0:
+ iDiv = 50
+ else:
+ iDiv = (gWidth)/18
+ if iDiv == 0:
+ iDiv = 50
+ scale = ((self.iLengthInMeasures / iDiv) + 1)
+ if scale == 0:
+ scale = 1
+ beatStep = step / 4.0
+ dc.SetFont(self.font)
+ j = 0
+ lastEnd = 0
+ num = range(self.iStartMeasure, self.iStartMeasure + self.iLengthInMeasures + 1, 1)
+ dc.SetPen(wx.Pen('#5C5142'))
+ for i in range(0, (self.iLengthInMeasures+1)*step, step):
+ k = i + self.iEdges
+ dc.DrawLine(k, self.iScaleTop, k, self.iScaleTop+8)
+ if i != (self.iLengthInMeasures)*step:
+ for iBeat in range(1,4):
+ k = i+(iBeat * beatStep) + self.iEdges
+ dc.DrawLine(k, self.iScaleTop, k, self.iScaleTop+4)
+ width, height = dc.GetTextExtent(str(num[j]))
+ k = i-(width/2) + self.iEdges
+ if k > lastEnd:
+ if j == 0 or (j % scale) == 0:
+ dc.DrawText(str(num[j]), k, self.iScaleTop+8)
+ lastEnd = k + width
+ j = j + 1
+
+ """ Updates the location bar in case screen moved or resized """
+ if self.iLocationInMs > 0 and self.iLengthInMs > 0:
+ iOffset = 0
+ if self.iMidiMode:
+ iOffset = self.iMidiModeStart
+
+ till = gWidth * (self.iLocationInMs / self.iLengthInMs)
+ dc.SetPen(wx.Pen(PROGRESS_BAR))
+ dc.SetBrush(wx.Brush(PROGRESS_BAR))
+ dc.DrawRectangle(self.iEdges + iOffset, gHeight-6, till, 3)
+
+ def UpdateLocation(self, iLocationInMs):
+ """ Updates the location bar """
+ #disable graph for debugging
+ #return info
+
+ self.iLocationInMs = iLocationInMs
+ if self.iLocationInMs > 0 and self.iLengthInMs > 0:
+ if OsWindows():
+ dc = wx.BufferedDC(wx.ClientDC(self), self._Buffer)
+ else:
+ dc = wx.AutoBufferedPaintDC(self)
+ dc.Background = wx.Brush(wx.WHITE)
+
+ iOffset = 0
+ if self.iMidiMode:
+ iOffset = self.iMidiModeStart
+
+ gWidth, gHeight = self.GetSize()
+ gWidth = gWidth - (self.iEdges * 2)
+
+ till = gWidth * (self.iLocationInMs / self.iLengthInMs)
+ dc.SetPen(wx.Pen(PROGRESS_BAR))
+ dc.SetBrush(wx.Brush(PROGRESS_BAR))
+ dc.DrawRectangle(self.iEdges + iOffset, gHeight-6, till, 3)
+ self.isDirty = True
+ else:
+ if self.isDirty:
+ self.DoDrawing()
+ self.isDirty = False
diff --git a/jet_tools/JetCreator/JetStatusEvent.py b/jet_tools/JetCreator/JetStatusEvent.py
new file mode 100755
index 0000000..64b4b50
--- /dev/null
+++ b/jet_tools/JetCreator/JetStatusEvent.py
@@ -0,0 +1,38 @@
+"""
+ File:
+ JetStatusEvent.py
+
+ Contents and purpose:
+ Creates an event for postevent callbacks
+
+ Copyright (c) 2008 Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+"""
+
+import wx
+
+EVT_JET_STATUS_ID = wx.NewId()
+
+def EVT_JET_STATUS(win, func):
+ win.Connect(-1, -1, EVT_JET_STATUS_ID, func)
+
+class JetStatusEvent(wx.PyEvent):
+ """Used for posting events out of play thread back to UI"""
+ def __init__(self, mode, data):
+ wx.PyEvent.__init__(self)
+ self.SetEventType(EVT_JET_STATUS_ID)
+ self.mode = mode
+ self.data = data
+
+
diff --git a/jet_tools/JetCreator/JetSystemInfo.py b/jet_tools/JetCreator/JetSystemInfo.py
new file mode 100755
index 0000000..a9ac932
--- /dev/null
+++ b/jet_tools/JetCreator/JetSystemInfo.py
@@ -0,0 +1,40 @@
+"""
+ File:
+ JetSystemInfo.py
+
+ Contents and purpose:
+ Displays the system info regarding os version, wxPython version, and Python version
+
+ Copyright (c) 2008 Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+"""
+
+import sys
+import os
+import string
+import wx
+
+print("")
+print("wxPython Version:")
+print(wx.__version__)
+
+print("")
+print("Python Version:")
+print(sys.version)
+
+print("")
+print("Python Paths:")
+for dir in string.split(os.environ['PYTHONPATH'], os.pathsep):
+ print dir
+
diff --git a/jet_tools/JetCreator/JetUtils.py b/jet_tools/JetCreator/JetUtils.py
new file mode 100755
index 0000000..d81e34d
--- /dev/null
+++ b/jet_tools/JetCreator/JetUtils.py
@@ -0,0 +1,788 @@
+"""
+ File:
+ JetUtils.py
+
+ Contents and purpose:
+ Utilities used throughout JetCreator
+
+ Copyright (c) 2008 Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+"""
+
+from __future__ import with_statement
+
+import wx
+import os
+import copy
+import ConfigParser
+import logging
+import time
+import tempfile
+
+from JetDefs import *
+from JetDebug import *
+from midifile import TimeBase, trackGrid
+
+class JetCutCopy(object):
+ """ Handles cut/copy/pasting of events and segments """
+ def __init__ (self, objType, objSave, currentSegmentName):
+ self.objType = objType
+ self.objSave = copy.deepcopy(objSave)
+ self.currentSegmentName = currentSegmentName
+
+ def GetObj(self, objList):
+ """ Gets an object """
+ objSave = copy.deepcopy(self.objSave)
+ if self.objType == JetDefs.MAIN_SEGLIST:
+ oldName = objSave.segname
+ i = len(oldName) - 1
+ while i > 0:
+ if not oldName[i].isdigit():
+ break
+ i = i - 1
+ oldName = oldName[0:i+1]
+ i = 1
+ while True:
+ newName = oldName + str(i)
+ if self.UniqueSegName(newName, objList):
+ break
+ i = i + 1
+ objSave.segname = newName
+ elif self.objType == JetDefs.MAIN_EVENTLIST:
+ oldName = objSave.event_name
+ i = len(oldName) - 1
+ while i > 0:
+ if not oldName[i].isdigit():
+ break
+ i = i - 1
+ oldName = oldName[0:i+1]
+ i = 1
+ while True:
+ newName = oldName + str(i)
+ if self.UniqueEventName(newName, objList):
+ break
+ i = i + 1
+ objSave.event_name = newName
+ return objSave
+
+ def UniqueSegName(self, nameVal, seglist):
+ for nm in seglist:
+ if nm.segname == nameVal:
+ return False
+ return True
+
+ def UniqueEventName(self, nameVal, eventlist):
+ for nm in eventlist:
+ if nm.event_name == nameVal:
+ return False
+ return True
+
+
+class JetState(object):
+ """ Saves the state for cut/copy/paste """
+ def __init__ (self, jet_file, currentSegmentIndex, currentEventIndex):
+ self.jet_file = copy.deepcopy(jet_file)
+ self.currentSegmentIndex = currentSegmentIndex
+ self.currentEventIndex = currentEventIndex
+
+def Queue (jet, queueSeg):
+ """ Queues a segment """
+ jet.QueueSegment(queueSeg.userID, queueSeg.seg_num, queueSeg.dls_num, queueSeg.repeat, queueSeg.transpose, queueSeg.mute_flags)
+
+class QueueSeg(object):
+ """ Object representing a segment """
+ def __init__ (self, name, userID, seg_num, dls_num=-1, repeat=0, transpose=0, mute_flags=0, status=''):
+ self.name = name
+ self.userID = userID
+ self.seg_num = seg_num
+ self.dls_num = dls_num
+ self.repeat = repeat
+ self.transpose = transpose
+ self.mute_flags = mute_flags
+ self.status = status
+ #DumpQueueSeg(self)
+
+def FindDlsNum(libraries, dlsfile):
+ """ Looks for a dls file in the library list """
+ for index, library in enumerate(libraries):
+ if library == dlsfile:
+ return index
+ return -1
+
+def SetRowSelection(list, row, state):
+ """ Sets the selection status of a list row """
+ if state:
+ list.SetItemState(row, wx.LIST_STATE_SELECTED, wx.LIST_STATE_SELECTED)
+ else:
+ list.SetItemState(row, ~wx.LIST_STATE_SELECTED, wx.LIST_STATE_SELECTED)
+
+def ClearRowSelections(list):
+ """ Clears the list rows selection status """
+ index = list.GetFirstSelected()
+ while index != -1:
+ SetRowSelection(list, index, False)
+ index = list.GetNextSelected(index)
+
+def getColumnText(list, index, col):
+ """ Sets the text of a column """
+ item = list.GetItem(index, col)
+ return item.GetText()
+
+def getColumnValue(list, index, col):
+ """ Gets the text of a column """
+ item = list.GetItem(index, col)
+ v = str(item.GetText())
+ if len(v) > 0:
+ return int(item.GetText())
+ else:
+ return 0
+
+def StrNoneChk(fld):
+ """ Returns a blank string if none """
+ if fld is None:
+ return ""
+ return str(fld)
+
+def ConvertStrTimeToTuple(s):
+ """ Converts a string time to a tuple """
+ try:
+ measures, beats, ticks = s.split(':',3)
+ return (int(measures), int(beats), int(ticks))
+ except:
+ return JetDefs.MBT_DEFAULT
+
+def FileRelativePath(target, base=os.curdir):
+ """ Returns relative file path """
+ if not os.path.exists(target):
+ return target
+
+ if not os.path.isdir(base):
+ return target
+
+ base_list = (os.path.abspath(base)).split(os.sep)
+ target_list = (os.path.abspath(target)).split(os.sep)
+ if os.name in ['nt','dos','os2'] and base_list[0] <> target_list[0]:
+ return target
+ for i in range(min(len(base_list), len(target_list))):
+ if base_list[i] <> target_list[i]: break
+ else:
+ i+=1
+ rel_list = [os.pardir] * (len(base_list)-i) + target_list[i:]
+ return os.path.join(*rel_list)
+
+def FileFixPath(fileSpec):
+ """ Tweaks slashes """
+ return fileSpec.replace("\\", "/")
+
+def FileKillClean(fileName):
+ """ Deletes a file skipping errors """
+ try:
+ os.remove(fileName)
+ except:
+ pass
+
+def FileJustRoot(fileName):
+ """ Gets just the root of the file name """
+ try:
+ return os.path.splitext(fileName)[0]
+ except:
+ return ""
+
+def FileJustName(fileName):
+ """ Gets just the filename, without the path """
+ try:
+ return os.path.split(fileName)[1]
+ except:
+ return ""
+
+def FileJustPath(fileName):
+ """ Gets just the path, without the file name """
+ try:
+ return os.path.split(fileName)[0]
+ except:
+ return ""
+
+def FileJustExt(fileName):
+ """ Gets just the extension of the file """
+ try:
+ ext = os.path.splitext(fileName)[1]
+ return ext.upper()
+ except:
+ return ""
+
+def FileDateTime(fileName):
+ """ Gets the date/time of a file """
+ try:
+ filetime = time.ctime(os.path.getmtime(fileName))
+ return filetime
+ except:
+ return ""
+
+def FileExists(fileName):
+ """ Checks if a file exists """
+ try:
+ return os.path.exists(fileName)
+ except:
+ return False
+
+def IniSetValue(configFile, section, option, value):
+ """ Sets the value of a config file field """
+ config = ConfigParser.ConfigParser()
+ config.read(configFile)
+ if not config.has_section(section):
+ config.add_section(section)
+ config.set(section, option, value)
+ cfgfile = open(configFile,'w')
+ config.write(cfgfile)
+ cfgfile.close()
+
+def IniGetValue(configFile, section, option, retType='str', default=''):
+ """ Gets the value of a config file field """
+ ret = default
+ config = ConfigParser.ConfigParser()
+ config.read(configFile)
+ if config.has_section(section):
+ if config.has_option(section, option):
+ ret = config.get(section, option)
+ if retType =='int':
+ try:
+ ret = int(ret)
+ except:
+ ret = 0
+ elif retType == 'float':
+ try:
+ ret = float(ret)
+ except:
+ ret = 0
+ elif retType == 'bool':
+ try:
+ if ret[0].upper()=='T':
+ ret = True
+ else:
+ ret = False
+ except:
+ ret = False
+ elif retType == 'list':
+ try:
+ ret = eval(ret)
+ except:
+ ret = []
+ return ret
+
+def GetRecentJetFiles():
+ """ Builds a list of recent jet files """
+ fileList = []
+ config = ConfigParser.ConfigParser()
+ config.read(JetDefs.JETCREATOR_INI)
+ if config.has_section(JetDefs.RECENT_SECTION):
+ for count in range(0, 10):
+ sFile = "File" + str(count)
+ if config.has_option(JetDefs.RECENT_SECTION, sFile):
+ sFileName = config.get(JetDefs.RECENT_SECTION, sFile)
+ if FileExists(sFileName):
+ if sFileName != JetDefs.UNTITLED_FILE:
+ #fileList.append(FileRelativePath(config.get(JetDefs.RECENT_SECTION, sFile)))
+ fileList.append(config.get(JetDefs.RECENT_SECTION, sFile))
+ return fileList
+
+def AppendRecentJetFile(jetFile):
+ """ Appends to a list of recent jet files """
+ addedFiles = []
+ fileList = GetRecentJetFiles()
+ config = ConfigParser.ConfigParser()
+ config.read(JetDefs.JETCREATOR_INI)
+ if config.has_section(JetDefs.RECENT_SECTION):
+ config.remove_section(JetDefs.RECENT_SECTION)
+ config.add_section(JetDefs.RECENT_SECTION)
+ config.set(JetDefs.RECENT_SECTION, "File0", jetFile)
+ addedFiles.append(jetFile)
+ count = 1
+ for file in fileList:
+ if file not in addedFiles:
+ sFile = "File" + str(count)
+ config.set(JetDefs.RECENT_SECTION, sFile, file)
+ addedFiles.append(file)
+ count += 1
+ FileKillClean(JetDefs.JETCREATOR_INI)
+ cfgfile = open(JetDefs.JETCREATOR_INI,'w')
+ config.write(cfgfile)
+ cfgfile.close()
+
+def CompareMbt(mbt1, mbt2):
+ """ Compates to measure/beat/tick values """
+ try:
+ m1, b1, t1 = mbt1.split(':',3)
+ m2, b2, t2 = mbt2.split(':',3)
+ if int(m1) > int(m2):
+ return False
+ elif int(m1) == int(m2) and int(b1) > int(b2):
+ return False
+ elif int(b1) == int(b2) and int(t1) > int(t2):
+ return False
+ elif int(m1) == int(m2) and int(b1) == int(b2) and int(t1) == int(t2):
+ return False
+ else:
+ return True
+ except:
+ return False
+
+def MbtVal(mbt):
+ """ Converts mbts to ticks """
+ if type(mbt).__name__=='str' or type(mbt).__name__=='unicode':
+ mbt1 = mbt
+ else:
+ mbt1 = "%d:%d:%d" % mbt
+ try:
+ return TimeBase().ConvertStrTimeToTicks(mbt1)
+ except:
+ return 0
+
+def TicksToMbt(ticks):
+ """ Converts ticks to mbts """
+ return TimeBase().ConvertTicksToMBT(ticks)
+
+def TicksToStrMbt(ticks):
+ """ Converts ticks to mbts """
+ return TimeBase().ConvertTicksToStr(ticks, '%02d:%02d:%02d')
+
+def MbtDifference(mbt1, mbt2):
+ """ Returns difference between mbt values """
+ return TimeBase().MbtDifference(mbt1, mbt2)
+
+def PlayMidiFile(midiFile, dlsFile=''):
+ """ Plays a midi file """
+ try:
+ e = __import__('eas')
+
+ if midiFile == '':
+ return
+ eas = e.EAS()
+ if dlsFile > '':
+ eas.LoadDLSCollection(dlsFile)
+ eas.StartWave()
+ audio_file = eas.OpenFile(midiFile)
+ audio_file.Prepare()
+ audio_file.Play()
+ audio_file.Close()
+ eas.StopWave()
+ eas.Shutdown()
+ except:
+ return
+
+def SegmentOutputFile(segName, configFile):
+ """ Computes a segment output file """
+ configPath = FileJustPath(configFile) + "/"
+ segOutput = configPath + "Seg_" + segName + ".mid"
+ return segOutput
+
+def ComputeMuteFlags(jet_file, segName):
+ """ Computes mute flags """
+ muteFlag = 0
+ for jet_event in jet_file.GetEvents(segName):
+ muteFlag = SetMute(jet_event.track_num, muteFlag)
+ return muteFlag
+
+def ComputeMuteFlagsFromList1(list):
+ """ Computes mute flags from a list """
+ muteFlag = 0
+ num = list.GetItemCount()
+ for iRow in range(num):
+ track_num = list.GetTrackNumber(iRow)
+ if list.IsChecked(iRow):
+ muteFlag = SetMute(track_num, muteFlag)
+ else:
+ muteFlag = ClearMute(track_num, muteFlag)
+ return muteFlag
+
+def ComputeMuteFlagsFromList(list):
+ """ Computes mute flags from a list """
+ muteFlags = 0
+ num = list.GetItemCount()
+ for iRow in range(num):
+ track_num = list.GetTrackNumber(iRow)
+ if list.IsChecked(iRow):
+ muteFlags = SetMute(track_num, muteFlags)
+ return muteFlags
+
+
+def SetMuteFlag(track, muteFlag, mute):
+ """ Sets a mute flag """
+ if mute:
+ SetMute(track, muteFlag)
+ else:
+ ClearMute(track, muteFlag)
+
+def SetMute(track, muteFlag):
+ """ Sets a mute flag """
+ try:
+ muteFlag |= 1 << (track)
+ return muteFlag
+ except:
+ #bad argument
+ return muteFlag
+
+def ClearMute(track, muteFlag):
+ """ Clears a mute flag """
+ try:
+ muteFlag &= ~(1 << (track))
+ return muteFlag;
+ except:
+ #bad argument
+ return muteFlag
+
+def GetMute(track, muteFlag):
+ """ Get a mute flag """
+ try:
+ if (muteFlag & ( 1 << (track))) == 0:
+ return False
+ else:
+ return True
+ except:
+ #bad argument
+ return False
+
+def InfoMsg(msgTitle, msgText):
+ """ Display a simple informational message """
+ dlg = wx.MessageDialog(None,
+ message=msgText,
+ caption=msgTitle,
+ style=wx.OK|wx.ICON_INFORMATION
+ )
+ dlg.ShowModal()
+ dlg.Destroy()
+
+def SendEvent (mycontrol, evt):
+ """ Sends an event """
+ cmd = wx.CommandEvent(evt)
+ cmd.SetEventObject(mycontrol)
+ cmd.SetId(mycontrol.GetId())
+ mycontrol.GetEventHandler().ProcessEvent(cmd)
+
+def GetJetHelpText(dlgName, fld):
+ """ Gets the jet help text file """
+ return IniGetValue(JetDefs.JETCREATOR_HLP, dlgName, fld)
+
+def ExportJetArchive(fileName, jetConfigFile, jetFile):
+ """ Exports all files into a zip archive file """
+ z = __import__('zipfile')
+ zip = z.ZipFile(fileName, 'w')
+
+ #zip the original .JET file
+ if FileExists(jetFile.config.filename):
+ zip.write(jetFile.config.filename, FileJustName(jetFile.config.filename))
+
+ #make copy of object so we can modify it
+ jet_file = copy.deepcopy(jetFile)
+
+ #zip the files, without paths
+ for segment in jet_file.GetSegments():
+ if FileExists(segment.filename):
+ if not FileJustName(segment.filename) in zip.namelist():
+ zip.write(segment.filename, FileJustName(segment.filename))
+ if FileExists(segment.output):
+ if not FileJustName(segment.output) in zip.namelist():
+ zip.write(segment.output, FileJustName(segment.output))
+
+ #zip the library files
+ for library in jet_file.GetLibraries():
+ if FileExists(library):
+ if not FileJustName(library) in zip.namelist():
+ zip.write(library, FileJustName(library))
+
+ #remove the paths on filenames
+ for segment in jet_file.GetSegments():
+ segment.filename = FileJustName(segment.filename)
+ segment.dlsfile = FileJustName(segment.dlsfile)
+ segment.output = FileJustName(segment.output)
+
+ #remove paths
+ for index, library in enumerate(jet_file.libraries):
+ jet_file.libraries[index] = FileJustName(library)
+
+ #create temporary .JTC file so we can modify paths to files
+ tmpConfigFile = JetDefs.TEMP_JET_CONFIG_FILE
+ FileKillClean(tmpConfigFile)
+
+ #save the file
+ jet_file.SaveJetConfig(tmpConfigFile)
+
+ #zip it and rename it back to original name without path
+ zip.write(tmpConfigFile, FileJustName(jetConfigFile))
+
+ #create a flag file so we know this is a jet archive
+ zip.write(tmpConfigFile, "JetArchive")
+
+ zip.close()
+
+ FileKillClean(tmpConfigFile)
+
+def ValidateConfig(test_jet_file):
+ """ Validates the contents of a config file """
+ dImp = __import__('JetDialogs')
+ errors = []
+ fatalError = False
+ for segment in test_jet_file.segments:
+ logging.debug(segment.filename)
+ if segment.filename is not None and len(segment.filename) > 0 and not FileExists(segment.filename):
+ errors.append(("Segment MIDI file not found", segment.filename))
+ fatalError = True
+ if segment.dlsfile is not None and len(segment.dlsfile) > 0 and not FileExists(segment.dlsfile):
+ errors.append(("Segment DLS file not found; removing from config", segment.dlsfile))
+ segment.dlsfile = ""
+
+ logging.debug(test_jet_file.config.filename)
+
+ if len(errors) == 0:
+ return True
+ else:
+ dlg = dImp.JetErrors("Jet Definition File Errors")
+ dlg.SetErrors(errors)
+ result = dlg.ShowModal()
+ dlg.Destroy()
+ if fatalError:
+ return False
+ else:
+ return True
+
+def release_getLogger(name):
+ """ passing original handler with debug() method replaced to empty function """
+
+ def dummy(*k, **kw):
+ pass
+
+ global __orig_getLogger
+ log = __orig_getLogger(name)
+ setattr(log, 'debug', dummy)
+ setattr(log, 'info', dummy)
+ setattr(log, 'error', dummy)
+ setattr(log, 'critical', dummy)
+ return log
+
+def install_release_loggers():
+ """ Save original handler, installs newer one """
+ global __orig_getLogger
+ __orig_getLogger = logging.getLogger
+ setattr(logging, 'getLogger', release_getLogger)
+
+def restore_getLogger():
+ """ Restores original handler """
+ global __orig_getLogger
+ if __orig_getLogger:
+ setattr(logging, 'getLogger', __orig_getLogger)
+
+def GetMidiFileLength(midiFile):
+ """ Gets the length of a midi file via eas """
+ e = __import__('eas')
+
+ if not FileExists(midiFile):
+ return 0
+
+ eas = e.EAS()
+ audio_file = eas.OpenFile(midiFile)
+ audio_file.Prepare()
+ midiLength = eas.audio_streams[0].ParseMetaData()
+ audio_file.Close()
+ eas.Shutdown()
+ return midiLength
+
+def GetMidiInfo(midiFile):
+ """ Gets midi file info """
+ m = __import__('midifile')
+ md = m.GetMidiInfo(midiFile)
+ return md
+
+def PrintMidiInfo(midiFile):
+ """ Prints info about a midi file """
+ mi = GetMidiInfo(midiFile)
+ if mi.err == 0:
+ print("ppqn: " + str(mi.ppqn))
+ print("beats_per_measure: " + str(mi.beats_per_measure))
+ print("ending mbt: " + str(mi.endMbt))
+ print("ending mbt str: " + mi.endMbtStr)
+ print("maxMeasures: " + str(mi.maxMeasures))
+ print("maxBeats: " + str(mi.maxBeats))
+ print("maxTicks: " + str(mi.maxTicks))
+ print("maxTracks: " + str(mi.maxTracks))
+ print("totalTicks: " + str(mi.totalTicks))
+ for track in mi.trackList:
+ print(track)
+ else:
+ print("Error opening")
+
+def MidiSegInfo(segment):
+ """ Midi file info saved in config file for speed """
+ class segInfo:
+ iMsPerTick = 0
+ bpm = 4
+ ppqn = 480
+ total_ticks = 0
+ iLengthInMs = 0
+ iTracks = 0
+ trackList = []
+
+ ver = "1.5"
+ ret = segInfo()
+ savedVer = IniGetValue(JetDefs.JETMIDIFILES_INI, segment.filename, "Ver")
+ savedDateTime = IniGetValue(JetDefs.JETMIDIFILES_INI, segment.filename, "DateTime")
+ dateTime = FileDateTime(segment.filename)
+ if ver != savedVer or dateTime != savedDateTime:
+ mi = GetMidiInfo(segment.filename)
+ if mi.err == 0:
+ IniSetValue(JetDefs.JETMIDIFILES_INI, segment.filename, "Ver", ver)
+ IniSetValue(JetDefs.JETMIDIFILES_INI, segment.filename, "DateTime", str(dateTime))
+ IniSetValue(JetDefs.JETMIDIFILES_INI, segment.filename, "PPQN", str(mi.ppqn))
+ IniSetValue(JetDefs.JETMIDIFILES_INI, segment.filename, "BPM", str(mi.beats_per_measure))
+ IniSetValue(JetDefs.JETMIDIFILES_INI, segment.filename, "totalTicks", str(mi.totalTicks))
+ IniSetValue(JetDefs.JETMIDIFILES_INI, segment.filename, "maxTracks", str(mi.maxTracks))
+ iLengthInMs = GetMidiFileLength(segment.filename) * 1000
+ IniSetValue(JetDefs.JETMIDIFILES_INI, segment.filename, "LengthInMs", str(iLengthInMs))
+ if iLengthInMs > 0:
+ IniSetValue(JetDefs.JETMIDIFILES_INI, segment.filename, "MsPerTick", str(iLengthInMs / mi.totalTicks))
+ #have to write out the tracklist in format that can be saved in INI file
+ tl = []
+ for track in mi.trackList:
+ tl.append((track.track, track.channel, track.name))
+ IniSetValue(JetDefs.JETMIDIFILES_INI, segment.filename, "Tracks", tl)
+
+ trackList = []
+ tl = IniGetValue(JetDefs.JETMIDIFILES_INI, segment.filename, "Tracks", 'list', [])
+ for t in tl:
+ trackList.append(trackGrid(t[0], t[1], t[2],False))
+ iTracks = IniGetValue(JetDefs.JETMIDIFILES_INI, segment.filename, "maxTracks", 'int', 0)
+ iMsPerTick = IniGetValue(JetDefs.JETMIDIFILES_INI, segment.filename, "MsPerTick", 'float', 0)
+ bpm = IniGetValue(JetDefs.JETMIDIFILES_INI, segment.filename, "BPM", 'int', 0)
+ ppqn = IniGetValue(JetDefs.JETMIDIFILES_INI, segment.filename, "PPQN", 'int', 480)
+ if iMsPerTick == 0 or bpm == 0 or ppqn == 0:
+ return ret
+ tb = TimeBase(ppqn, bpm)
+ total_ticks = tb.ConvertStrTimeToTicks(segment.length)
+ if total_ticks == 0:
+ total_ticks = tb.MbtDifference(tb.ConvertStrTimeToTuple(segment.start), tb.ConvertStrTimeToTuple(segment.end))
+ if total_ticks == 0:
+ return ret
+
+ ret.iTracks = iTracks
+ ret.iMsPerTick = iMsPerTick
+ ret.bpm = bpm
+ ret.ppqn = ppqn
+ ret.total_ticks = total_ticks
+ ret.iLengthInMs = total_ticks * iMsPerTick
+ ret.trackList = trackList
+ return ret
+
+def TimeStr(ms):
+ """ Returns a time string """
+ s=ms/1000
+ m,s=divmod(s,60)
+ h,m=divmod(m,60)
+ d,h=divmod(h,24)
+ if m > 0:
+ return "%d Min %d Sec" % (m,s)
+ else:
+ return "%d Seconds" % (s)
+
+def mbtFct(mbt, mod):
+ """ Converts times """
+ if type(mbt).__name__=='str' or type(mbt).__name__=='unicode':
+ mbt = ConvertStrTimeToTuple(mbt)
+ retType = 'str'
+ else:
+ retType = 'int'
+
+ m = mbt[0]+mod
+ b = mbt[1]+mod
+ t = mbt[2]
+ if m < 0:
+ m = 0
+ if b < 0:
+ b = 0
+ if b > 4:
+ b = 4
+ if t < 0:
+ t = 0
+
+ if retType == 'str':
+ return "%d:%d:%d" % (m, b, t)
+ else:
+ return (m, b, t)
+
+def OsWindows():
+ """ Tells us whether windows or os x """
+ if os.name == 'nt':
+ return True ;
+ else:
+ return False ;
+
+def MacOffset():
+ """ Mac screen coordinates funky on some controls so we finagle a few pixels """
+ if not OsWindows():
+ return 3
+ else:
+ return 0
+
+def SafeJetShutdown(lock, jet):
+ """ Makes sure we do the jet shutdown properly """
+ with lock:
+ #MAKE SURE WE CLEANUP
+ #try: jet.Clear_Queue()
+ #except: pass
+
+ try: jet.eas.StopWave()
+ except: pass
+
+ try: jet.Shutdown()
+ except: pass
+
+ jet = None
+
+
+def CreateTempJetFile(org_jet_file):
+ """ Creates temporary jet file for playback testing """
+ dirname = JetDefs.TEMP_JET_DIR
+ if not os.path.isdir(dirname):
+ os.mkdir(dirname)
+
+ tmpConfigFile = dirname + FileJustName(org_jet_file.config_file)
+ FileKillClean(tmpConfigFile)
+
+ jet_file = copy.deepcopy(org_jet_file)
+
+ for tmp in jet_file.segments:
+ tmp.output = dirname + FileJustName(tmp.output)
+
+ jet_file.config_file = tmpConfigFile
+ jet_file.config.filename = dirname + FileJustName(jet_file.config.filename)
+ FileKillClean(jet_file.config.filename)
+
+ jet_file.SaveJetConfig(tmpConfigFile)
+ jet_file.WriteJetFileFromConfig(tmpConfigFile)
+
+ return jet_file
+
+def CleanupTempJetFile(jet_file):
+ """ Cleans up temporary files """
+ FileKillClean(jet_file.config.filename)
+ FileKillClean(jet_file.config_file)
+ for tmp in jet_file.segments:
+ FileKillClean(tmp.output)
+
+def GetNow():
+ return time.asctime()
+
+
+if __name__ == '__main__':
+ """ Tests functions """
+ pass
+
+ \ No newline at end of file
diff --git a/jet_tools/JetCreator/ReadMe1st.txt b/jet_tools/JetCreator/ReadMe1st.txt
new file mode 100755
index 0000000..121ae32
--- /dev/null
+++ b/jet_tools/JetCreator/ReadMe1st.txt
@@ -0,0 +1,44 @@
+#
+# Copyright (C) 2009 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the 'License');
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an 'AS IS' BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+PREREQUISITES
+
+JetCreator was created and tested with:
+
+Python Version 2.5.4
+wxPython Version 2.8.7.1
+
+These can be downloaded here:
+
+PC
+
+http://www.python.org/download/releases/2.5.4/
+http://www.wxpython.org/download.php
+
+MAC
+
+http://wiki.python.org/moin/MacPython/Leopard
+http://www.wxpython.org/download.php
+
+
+
+INSTALLING
+
+1. Install Python
+2. Install wxPython
+3. Unzip or copy the JetCreator directory
+4. Execute JetCreator.py
+5. Use Import to import simple example project off Demos directory
diff --git a/jet_tools/JetCreator/eas.py b/jet_tools/JetCreator/eas.py
new file mode 100755
index 0000000..127314b
--- /dev/null
+++ b/jet_tools/JetCreator/eas.py
@@ -0,0 +1,1229 @@
+
+from __future__ import with_statement
+
+import threading
+import logging
+import time
+from ctypes import *
+from JetUtils import OsWindows
+
+
+# stream state
+EAS_STATE_READY = 0
+EAS_STATE_PLAY = 1
+EAS_STATE_STOPPING = 2
+EAS_STATE_PAUSING = 3
+EAS_STATE_STOPPED = 4
+EAS_STATE_PAUSED = 5
+EAS_STATE_OPEN = 6
+EAS_STATE_ERROR = 7
+EAS_STATE_EMPTY = 8
+
+# EAS error codes
+EAS_SUCCESS = 0
+EAS_FAILURE = -1
+EAS_ERROR_INVALID_MODULE = -2
+EAS_ERROR_MALLOC_FAILED = -3
+EAS_ERROR_FILE_POS = -4
+EAS_ERROR_INVALID_FILE_MODE = -5
+EAS_ERROR_FILE_SEEK = -6
+EAS_ERROR_FILE_LENGTH = -7
+EAS_ERROR_NOT_IMPLEMENTED = -8
+EAS_ERROR_CLOSE_FAILED = -9
+EAS_ERROR_FILE_OPEN_FAILED = -10
+EAS_ERROR_INVALID_HANDLE = -11
+EAS_ERROR_NO_MIX_BUFFER = -12
+EAS_ERROR_PARAMETER_RANGE = -13
+EAS_ERROR_MAX_FILES_OPEN = -14
+EAS_ERROR_UNRECOGNIZED_FORMAT = -15
+EAS_BUFFER_SIZE_MISMATCH = -16
+EAS_ERROR_FILE_FORMAT = -17
+EAS_ERROR_SMF_NOT_INITIALIZED = -18
+EAS_ERROR_LOCATE_BEYOND_END = -19
+EAS_ERROR_INVALID_PCM_TYPE = -20
+EAS_ERROR_MAX_PCM_STREAMS = -21
+EAS_ERROR_NO_VOICE_ALLOCATED = -22
+EAS_ERROR_INVALID_CHANNEL = -23
+EAS_ERROR_ALREADY_STOPPED = -24
+EAS_ERROR_FILE_READ_FAILED = -25
+EAS_ERROR_HANDLE_INTEGRITY = -26
+EAS_ERROR_MAX_STREAMS_OPEN = -27
+EAS_ERROR_INVALID_PARAMETER = -28
+EAS_ERROR_FEATURE_NOT_AVAILABLE = -29
+EAS_ERROR_SOUND_LIBRARY = -30
+EAS_ERROR_NOT_VALID_IN_THIS_STATE = -31
+EAS_ERROR_NO_VIRTUAL_SYNTHESIZER = -32
+EAS_ERROR_FILE_ALREADY_OPEN = -33
+EAS_ERROR_FILE_ALREADY_CLOSED = -34
+EAS_ERROR_INCOMPATIBLE_VERSION = -35
+EAS_ERROR_QUEUE_IS_FULL = -36
+EAS_ERROR_QUEUE_IS_EMPTY = -37
+EAS_ERROR_FEATURE_ALREADY_ACTIVE = -38
+
+# special result codes
+EAS_EOF = 3
+EAS_STREAM_BUFFERING = 4
+
+# buffer full error returned from Render
+EAS_BUFFER_FULL = 5
+
+# file types
+file_types = (
+ 'Unknown',
+ 'SMF Type 0 (.mid)',
+ 'SMF Type 1 (.mid)',
+ 'SMAF - Unknown type (.mmf)',
+ 'SMAF MA-2 (.mmf)',
+ 'SMAF MA-3 (.mmf)',
+ 'SMAF MA-5 (.mmf)',
+ 'CMX/QualComm (.pmd)',
+ 'MFi (NTT/DoCoMo i-mode)',
+ 'OTA/Nokia (.ott)',
+ 'iMelody (.imy)',
+ 'RTX/RTTTL (.rtx)',
+ 'XMF Type 0 (.xmf)',
+ 'XMF Type 1 (.xmf)',
+ 'WAVE/PCM (.wav)',
+ 'WAVE/IMA-ADPCM (.wav)',
+ 'MMAPI Tone Control (.js)'
+)
+
+stream_states = (
+ 'Ready',
+ 'Play',
+ 'Stopping',
+ 'Stopped',
+ 'Pausing',
+ 'Paused',
+ 'Open',
+ 'Error',
+ 'Empty'
+)
+
+# iMode play modes
+IMODE_PLAY_ALL = 0
+IMODE_PLAY_PARTIAL = 1
+
+# callback type for metadata
+EAS_METADATA_CBFUNC = CFUNCTYPE(c_int, c_int, c_char_p, c_ulong)
+
+# callbacks for external audio
+EAS_EXT_PRG_CHG_FUNC = CFUNCTYPE(c_int, c_void_p, c_void_p)
+EAS_EXT_EVENT_FUNC = CFUNCTYPE(c_int, c_void_p, c_void_p)
+
+# callback for aux mixer decoder
+EAS_DECODER_FUNC = CFUNCTYPE(c_void_p, c_void_p, c_int, c_int)
+
+# DLL path
+if OsWindows():
+ EAS_DLL_PATH = "EASDLL.dll"
+else:
+ EAS_DLL_PATH = "libEASLIb.dylib"
+
+eas_dll = None
+
+# logger
+eas_logger = None
+
+#---------------------------------------------------------------
+# InitEASModule
+#---------------------------------------------------------------
+def InitEASModule (dll_path=None):
+ global eas_dll
+ global eas_logger
+
+
+ # initialize logger
+ if eas_logger is None:
+ eas_logger = logging.getLogger('EAS')
+
+ # initialize path to DLL
+ if dll_path is None:
+ dll_path=EAS_DLL_PATH
+
+ # intialize DLL
+ if eas_dll is None:
+ eas_dll = cdll.LoadLibrary(dll_path)
+
+#---------------------------------------------------------------
+# S_JET_CONFIG
+#---------------------------------------------------------------
+class S_JET_CONFIG (Structure):
+ _fields_ = [('appLowNote', c_ubyte)]
+
+#---------------------------------------------------------------
+# S_EXT_AUDIO_PRG_CHG
+#---------------------------------------------------------------
+class S_EXT_AUDIO_PRG_CHG (Structure):
+ _fields_ = [('bank', c_ushort),
+ ('program', c_ubyte),
+ ('channel', c_ubyte)]
+
+#---------------------------------------------------------------
+# S_EXT_AUDIO_EVENT
+#---------------------------------------------------------------
+class S_EXT_AUDIO_EVENT (Structure):
+ _fields_ = [('channel', c_ubyte),
+ ('note', c_ubyte),
+ ('velocity', c_ubyte),
+ ('noteOn', c_ubyte)]
+
+#---------------------------------------------------------------
+# S_MIDI_CONTROLLERS
+#---------------------------------------------------------------
+class S_MIDI_CONTROLLERS (Structure):
+ _fields_ = [('modWheel', c_ubyte),
+ ('volume', c_ubyte),
+ ('pan', c_ubyte),
+ ('expression', c_ubyte),
+ ('channelPressure', c_ubyte)]
+
+#---------------------------------------------------------------
+# WAVEFORMAT
+#---------------------------------------------------------------
+class WAVEFORMAT (Structure):
+ _fields_ = [('wFormatTag', c_ushort),
+ ('nChannels', c_ushort),
+ ('nSamplesPerSec', c_ulong),
+ ('nAvgBytesPerSec', c_ulong),
+ ('nBlockAlign', c_ushort),
+ ('wBitsPerSample', c_ushort)]
+
+#---------------------------------------------------------------
+# EAS_Exception
+#---------------------------------------------------------------
+class EAS_Exception (Exception):
+ def __init__ (self, result_code, msg, function=None):
+ self.msg = msg
+ self.result_code = result_code
+ self.function = function
+ def __str__ (self):
+ return self.msg
+
+#---------------------------------------------------------------
+# Log callback function
+#---------------------------------------------------------------
+# map EAS severity levels to the Python logging module
+severity_mapping = (logging.CRITICAL, logging.CRITICAL, logging.ERROR, logging.WARNING, logging.INFO, logging.DEBUG)
+LOG_FUNC_TYPE = CFUNCTYPE(c_int, c_int, c_char_p)
+def Log (level, msg):
+ eas_logger.log(severity_mapping[level], msg)
+ return level
+LogCallback = LOG_FUNC_TYPE(Log)
+
+#---------------------------------------------------------------
+# EAS_Stream
+#---------------------------------------------------------------
+class EAS_Stream (object):
+ def __init__ (self, handle, eas):
+ eas_logger.debug('EAS_Stream.__init__')
+ self.handle = handle
+ self.eas = eas
+
+ def SetVolume (self, volume):
+ """Set the stream volume"""
+ eas_logger.debug('Call EAS_SetVolume: volume=%d' % volume)
+ with self.eas.lock:
+ result = eas_dll.EAS_SetVolume(self.eas.handle, self.handle, volume)
+ if result:
+ raise EAS_Exception(result, 'EAS_SetVolume error %d on file %s' % (result, self.path), 'EAS_SetVolume')
+
+ def GetVolume (self):
+ """Get the stream volume."""
+ eas_logger.debug('Call EAS_GetVolume')
+ with self.eas.lock:
+ volume = eas_dll.EAS_GetVolume(self.eas.handle, self.handle)
+ if volume < 0:
+ raise EAS_Exception(volume, 'EAS_GetVolume error %d on file %s' % (volume, self.path), 'EAS_GetVolume')
+ eas_logger.debug('EAS_GetVolume: volume=%d' % volume)
+ return volume
+
+ def SetPriority (self, priority):
+ """Set the stream priority"""
+ eas_logger.debug('Call EAS_SetPriority: priority=%d' % priority)
+ with self.eas.lock:
+ result = eas_dll.EAS_SetPriority(self.eas.handle, self.handle, priority)
+ if result:
+ raise EAS_Exception(result, 'EAS_SetPriority error %d on file %s' % (result, self.path), 'EAS_SetPriority')
+
+ def GetPriority (self):
+ """Get the stream priority."""
+ eas_logger.debug('Call EAS_GetPriority')
+ priority = c_int(0)
+ with self.eas.lock:
+ result = eas_dll.EAS_GetPriority(self.eas.handle, self.handle, byref(priority))
+ if result:
+ raise EAS_Exception(result, 'EAS_GetPriority error %d on file %s' % (result, self.path), 'EAS_GetPriority')
+ eas_logger.debug('EAS_GetPriority: priority=%d' % priority.value)
+ return priority.value
+
+ def SetTransposition (self, transposition):
+ """Set the transposition of a stream."""
+ eas_logger.debug('Call EAS_SetTransposition: transposition=%d' % transposition)
+ with self.eas.lock:
+ result = eas_dll.EAS_SetTransposition(self.eas.handle, self.handle, transposition)
+ if result:
+ raise EAS_Exception(result, 'EAS_SetTransposition error %d on file %s' % (result, self.path), 'EAS_SetTransposition')
+
+ def SetPolyphony (self, polyphony):
+ """Set the polyphony of a stream."""
+ eas_logger.debug('Call EAS_SetPolyphony: polyphony=%d' % polyphony)
+ with self.eas.lock:
+ result = eas_dll.EAS_SetPolyphony(self.eas.handle, self.handle, polyphony)
+ if result:
+ raise EAS_Exception(result, 'EAS_SetPolyphony error %d on file %s' % (result, self.path), 'EAS_SetPolyphony')
+
+ def GetPolyphony (self):
+ """Get the polyphony of a stream."""
+ eas_logger.debug('Call EAS_GetPolyphony')
+ polyphony = c_int(0)
+ with self.eas.lock:
+ result = eas_dll.EAS_GetPolyphony(self.eas.handle, self.handle, byref(polyphony))
+ if result:
+ raise EAS_Exception(result, 'EAS_GetPolyphony error %d on file %s' % (result, self.path), 'EAS_GetPolyphony')
+ eas_logger.debug('EAS_SetPolyphony: polyphony=%d' % polyphony.value)
+ return polyphony.value
+
+ def SelectLib (self, test_lib=False):
+ eas_logger.debug('Call EAS_SelectLib: test_lib=%s' % test_lib)
+ with self.eas.lock:
+ result = eas_dll.EAS_SelectLib(self.eas.handle, self.handle, test_lib)
+ if result:
+ raise EAS_Exception(result, 'EAS_SelectLib error %d on file %s' % (result, self.path), 'EAS_SelectLib')
+
+ def LoadDLSCollection (self, path):
+ eas_logger.debug('Call EAS_LoadDLSCollection: lib_path=%d' % path)
+ with self.eas.lock:
+ result = eas_dll.EAS_LoadDLSCollection(self.eas.handle, self.handle, path)
+ if result:
+ raise EAS_Exception(result, 'EAS_LoadDLSCollection error %d on file %s lib %s' % (result, self.path, path), 'EAS_LoadDLSCollection')
+
+ def RegExtAudioCallback (self, user_data, prog_chg_func, event_func):
+ """Register an external audio callback."""
+ eas_logger.debug('Call EAS_RegExtAudioCallback')
+ if prog_chg_func is not None:
+ prog_chg_func = EAS_EXT_PRG_CHG_FUNC(prog_chg_func)
+ else:
+ prog_chg_func = 0
+ if event_func is not None:
+ event_func = EAS_EXT_EVENT_FUNC(event_func)
+ else:
+ event_func = 0
+ with self.eas.lock:
+ result = eas_dll.EAS_RegExtAudioCallback(self.eas.handle, self.handle, user_data, prog_chg_func, event_func)
+ if result:
+ raise EAS_Exception(result, 'EAS_RegExtAudioCallback error %d on file %s' % (result, self.path), 'EAS_RegExtAudioCallback')
+
+ def SetPlayMode (self, play_mode):
+ """Set play mode on a stream."""
+ eas_logger.debug('Call EAS_SetPlayMode: play_mode=%d' % play_mode)
+ with self.eas.lock:
+ result = eas_dll.EAS_SetPlayMode(self.eas.handle, self.handle, play_mode)
+ if result:
+ raise EAS_Exception(result, 'EAS_SetPlayMode error %d on file %s' % (result, self.path), 'EAS_SetPlayMode')
+
+"""
+EAS_PUBLIC EAS_RESULT EAS_GetMIDIControllers (EAS_DATA_HANDLE pEASData, EAS_HANDLE streamHandle, EAS_U8 channel, S_MIDI_CONTROLLERS *pControl);
+"""
+
+#---------------------------------------------------------------
+# EAS_File
+#---------------------------------------------------------------
+class EAS_File (EAS_Stream):
+ def __init__ (self, path, handle, eas):
+ EAS_Stream.__init__(self, handle, eas)
+ eas_logger.debug('EAS_File.__init__')
+ self.path = path
+ self.prepared = False
+
+ def Prepare (self):
+ """Prepare an audio file for playback"""
+ if self.prepared:
+ eas_logger.warning('Prepare already called on file %s' % self.path)
+ else:
+ with self.eas.lock:
+ eas_logger.debug('Call EAS_Prepare for file: %s' % self.path)
+ result = eas_dll.EAS_Prepare(self.eas.handle, self.handle)
+ if result:
+ raise EAS_Exception(result, 'EAS_Prepare error %d on file %s' % (result, self.path), 'EAS_Prepare')
+ self.prepared = True
+
+ def State (self):
+ """Get stream state."""
+ with self.eas.lock:
+ eas_logger.debug('Call EAS_State for file: %s' % self.path)
+ state = c_long(-1)
+ result = eas_dll.EAS_State(self.eas.handle, self.handle, byref(state))
+ if result:
+ raise EAS_Exception(result, 'EAS_State error %d on file %s' % (result, self.path), 'EAS_State')
+ eas_logger.debug('EAS_State: file=%s, state=%s' % (self.path, stream_states[state.value]))
+ return state.value
+
+ def Close (self):
+ """Close audio file."""
+ if hasattr(self, 'handle'):
+ with self.eas.lock:
+ eas_logger.debug('Call EAS_CloseFile for file: %s' % self.path)
+ result = eas_dll.EAS_CloseFile(self.eas.handle, self.handle)
+ if result:
+ raise EAS_Exception(result, 'EAS_CloseFile error %d on file %s' % (result, self.path), 'EAS_CloseFile')
+
+ # remove file from the EAS object
+ self.eas.audio_streams.remove(self)
+
+ # clean up references
+ del self.handle
+ del self.eas
+ del self.path
+
+ def Pause (self):
+ """Pause a stream."""
+ eas_logger.debug('Call EAS_Pause')
+ with self.eas.lock:
+ result = eas_dll.EAS_Pause(self.eas.handle, self.handle)
+ if result:
+ raise EAS_Exception(result, 'EAS_Pause error %d on file %s' % (result, self.path), 'EAS_Pause')
+
+ def Resume (self):
+ """Resume a stream."""
+ eas_logger.debug('Call EAS_Resume')
+ with self.eas.lock:
+ result = eas_dll.EAS_Resume(self.eas.handle, self.handle)
+ if result:
+ raise EAS_Exception(result, 'EAS_Resume error %d on file %s' % (result, self.path), 'EAS_Resume')
+
+ def Locate (self, secs, offset=False):
+ """Set the playback position of a stream in seconds."""
+ eas_logger.debug('Call EAS_Locate: location=%.3f, relative=%s' % (secs, offset))
+ with self.eas.lock:
+ result = eas_dll.EAS_Locate(self.eas.handle, self.handle, int(secs * 1000 + 0.5), offset)
+ if result:
+ raise EAS_Exception(result, 'EAS_Locate error %d on file %s' % (result, self.path), 'EAS_Locate')
+
+ def GetLocation (self):
+ """Get the stream location in seconds."""
+ eas_logger.debug('Call EAS_GetLocation')
+ msecs = c_int(0)
+ with self.eas.lock:
+ result = eas_dll.EAS_GetLocation(self.eas.handle, self.handle, byref(msecs))
+ if result:
+ raise EAS_Exception(result, 'EAS_GetLocation error %d on file %s' % (result, self.path), 'EAS_GetLocation')
+ msecs = float(msecs.value) / 1000
+ eas_logger.debug('EAS_GetLocation: location=%.3f' % msecs)
+ return msecs
+
+ def GetFileType (self):
+ """Get the file type."""
+ eas_logger.debug('Call EAS_GetFileType')
+ file_type = c_int(0)
+ with self.eas.lock:
+ result = eas_dll.EAS_GetFileType(self.eas.handle, self.handle, byref(file_type))
+ if result:
+ raise EAS_Exception(result, 'EAS_GetFileType error %d on file %s' % (result, self.path), 'EAS_GetFileType')
+ file_type = file_type.value
+ if file_type < len(file_types):
+ file_desc = file_types[file_type]
+ else:
+ file_desc = 'Unrecognized type %d' % file_type
+ eas_logger.debug('EAS_GetFileType: type=%d, desc=%s' % (file_type, file_desc))
+ return (file_type, file_desc)
+
+ def SetRepeat (self, count):
+ """Set the repeat count of a stream."""
+ eas_logger.debug('Call EAS_SetRepeat: count=%d' % count)
+ with self.eas.lock:
+ result = eas_dll.EAS_SetRepeat(self.eas.handle, self.handle, count)
+ if result:
+ raise EAS_Exception(result, 'EAS_SetRepeat error %d on file %s' % (result, self.path), 'EAS_SetRepeat')
+
+ def GetRepeat (self):
+ """Get the repeat count of a stream."""
+ eas_logger.debug('Call EAS_GetRepeat')
+ count = c_int(0)
+ with self.eas.lock:
+ result = eas_dll.EAS_GetRepeat(self.eas.handle, self.handle, byref(count))
+ if result:
+ raise EAS_Exception(result, 'EAS_GetRepeat error %d on file %s' % (result, self.path), 'EAS_GetRepeat')
+ eas_logger.debug('EAS_GetRepeat: count=%d' % count.value)
+ return count.value
+
+ def SetPlaybackRate (self, rate):
+ """Set the playback rate of a stream."""
+ eas_logger.debug('Call EAS_SetPlaybackRate')
+ with self.eas.lock:
+ result = eas_dll.EAS_SetPlaybackRate(self.eas.handle, self.handle, rate)
+ if result:
+ raise EAS_Exception(result, 'EAS_SetPlaybackRate error %d on file %s' % (result, self.path), 'EAS_SetPlaybackRate')
+
+ def ParseMetaData (self):
+ """Parse the metadata in a file."""
+ eas_logger.debug('Call EAS_ParseMetaData')
+ length = c_int(0)
+ with self.eas.lock:
+ result = eas_dll.EAS_ParseMetaData(self.eas.handle, self.handle, byref(length))
+ if result:
+ raise EAS_Exception(result, 'EAS_ParseMetaData error %d on file %s' % (result, self.path), 'EAS_ParseMetaData')
+ return float(length.value) / 1000.0
+
+ def RegisterMetaDataCallback (self, func, buf, buf_size, user_data):
+ """Register a metadata callback."""
+ eas_logger.debug('Call EAS_RegisterMetaDataCallback')
+ with self.eas.lock:
+ if func is not None:
+ callback = EAS_METADATA_CBFUNC(func)
+ else:
+ callback = 0
+ result = eas_dll.EAS_RegisterMetaDataCallback(self.eas.handle, self.handle, callback, buf, buf_size, user_data)
+ if result:
+ raise EAS_Exception(result, 'EAS_RegisterMetaDataCallback error %d on file %s' % (result, self.path), 'EAS_RegisterMetaDataCallback')
+
+ def GetWaveFmtChunk (self):
+ """Get the file type."""
+ eas_logger.debug('Call EAS_GetWaveFmtChunk')
+ wave_fmt_chunk = c_void_p(0)
+ with self.eas.lock:
+ result = eas_dll.EAS_GetWaveFmtChunk(self.eas.handle, self.handle, byref(wave_fmt_chunk))
+ if result:
+ raise EAS_Exception(result, 'EAS_GetWaveFmtChunk error %d on file %s' % (result, self.path), 'EAS_GetWaveFmtChunk')
+ return cast(wave_fmt_chunk, POINTER(WAVEFORMAT)).contents
+
+ def Play (self, max_time=None):
+ """Plays the file to the end or max_time."""
+ eas_logger.debug('EAS_File.Play')
+ if not self.prepared:
+ self.Prepare()
+ if max_time is not None:
+ max_time += self.eas.GetRenderTime()
+ while self.State() not in (EAS_STATE_STOPPED, EAS_STATE_ERROR, EAS_STATE_EMPTY):
+ self.eas.Render()
+ if max_time is not None:
+ if self.eas.GetRenderTime() >= max_time:
+ eas_logger.info('Max render time exceeded - stopping playback')
+ self.Pause()
+ self.eas.Render()
+ break
+
+#---------------------------------------------------------------
+# EAS_MIDIStream
+#---------------------------------------------------------------
+class EAS_MIDIStream (EAS_Stream):
+ def Write(self, data):
+ """Write data to MIDI stream."""
+ with self.eas.lock:
+ result = eas_dll.EAS_WriteMIDIStream(self.eas.handle, self.handle, data, len(data))
+ if result:
+ raise EAS_Exception(result, 'EAS_WriteMIDIStream error %d' % result, 'EAS_WriteMIDIStream')
+
+ def Close (self):
+ """Close MIDI stream."""
+ if hasattr(self, 'handle'):
+ with self.eas.lock:
+ eas_logger.debug('Call EAS_CloseMIDIStream')
+ result = eas_dll.EAS_CloseMIDIStream(self.eas.handle, self.handle)
+ if result:
+ raise EAS_Exception(result, 'EAS_CloseFile error %d' % result, 'EAS_CloseMIDIStream')
+
+ # remove file from the EAS object
+ self.eas.audio_streams.remove(self)
+
+ # clean up references
+ del self.handle
+ del self.eas
+
+#---------------------------------------------------------------
+# EAS_Config
+#---------------------------------------------------------------
+class EAS_Config (Structure):
+ _fields_ = [('libVersion', c_ulong),
+ ('checkedVersion', c_int),
+ ('maxVoices', c_long),
+ ('numChannels', c_long),
+ ('sampleRate', c_long),
+ ('mixBufferSize', c_long),
+ ('filterEnabled', c_int),
+ ('buildTimeStamp', c_ulong),
+ ('buildGUID', c_char_p)]
+
+#---------------------------------------------------------------
+# EAS
+#---------------------------------------------------------------
+class EAS (object):
+ def __init__ (self, handle=None, dll_path=None, log_file=None):
+ if eas_dll is None:
+ InitEASModule(dll_path)
+ if log_file is not None:
+ eas_logger.addHandler(log_file)
+ eas_logger.debug('EAS.__init__')
+ self.Init(handle)
+
+ def __del__ (self):
+ eas_logger.debug('EAS.__del__')
+ self.Shutdown()
+
+ def Init (self, handle=None):
+ """Initializes the EAS Library."""
+ eas_logger.debug('EAS.Init')
+
+ # if we are already initialized, shutdown first
+ if hasattr(self, 'handle'):
+ eas_logger.debug('EAS.Init called with library already initalized')
+ self.ShutDown()
+
+ # setup the logging function
+ eas_dll.SetLogCallback(LogCallback)
+
+ # create some members
+ self.handle = c_void_p(0)
+ self.audio_streams = []
+ self.output_streams = []
+ self.aux_mixer = None
+
+ # create a sync lock
+ self.lock = threading.RLock()
+ with self.lock:
+ # set log callback
+
+ # get library configuration
+ self.Config()
+
+ # initialize library
+ if handle is None:
+ self.do_shutdown = True
+ eas_logger.debug('Call EAS_Init')
+ result = eas_dll.EAS_Init(byref(self.handle))
+ if result:
+ raise EAS_Exception(result, 'EAS_Init error %d' % result, 'EAS_Init')
+ else:
+ self.do_shutdown = False
+ self.handle = handle
+
+ # allocate audio buffer for rendering
+ AudioBufferType = c_ubyte * (2 * self.config.mixBufferSize * self.config.numChannels)
+ self.audio_buffer = AudioBufferType()
+ self.buf_size = self.config.mixBufferSize
+
+ def Config (self):
+ """Retrieves the EAS library configuration"""
+ if not hasattr(self, 'config'):
+ eas_logger.debug('Call EAS_Config')
+ eas_dll.EAS_Config.restype = POINTER(EAS_Config)
+ self.config = eas_dll.EAS_Config()[0]
+ eas_logger.debug("libVersion=%08x, maxVoices=%d, numChannels=%d, sampleRate = %d, mixBufferSize=%d" %
+ (self.config.libVersion, self.config.maxVoices, self.config.numChannels, self.config.sampleRate, self.config.mixBufferSize))
+
+ def Shutdown (self):
+ """Shuts down the EAS library"""
+ eas_logger.debug('EAS.Shutdown')
+ if hasattr(self, 'handle'):
+ with self.lock:
+ # close audio streams
+ audio_streams = self.audio_streams
+ for f in audio_streams:
+ eas_logger.warning('Stream was not closed before EAS_Shutdown')
+ f.Close()
+
+ # close output streams
+ output_streams = self.output_streams
+ for s in output_streams:
+ s.close()
+
+ # shutdown library
+ if self.do_shutdown:
+ eas_logger.debug('Call EAS_Shutdown')
+ result = eas_dll.EAS_Shutdown(self.handle)
+ if result:
+ raise EAS_Exception(result, 'EAS_Shutdown error %d' % result, 'EAS_Shutdown')
+ del self.handle
+
+ def OpenFile (self, path):
+ """Opens an audio file to be played by the EAS library and
+ returns an EAS_File object
+
+ Arguments:
+ path - path to audio file
+
+ Returns:
+ EAS_File
+
+ """
+ with self.lock:
+ eas_logger.debug('Call EAS_OpenFile for file: %s' % path)
+ stream_handle = c_void_p(0)
+ result = eas_dll.EAS_OpenFile(self.handle, path, byref(stream_handle))
+ if result:
+ raise EAS_Exception(result, 'EAS_OpenFile error %d on file %s' % (result, path), 'EAS_OpenFile')
+
+ # create file object and save in list
+ stream = EAS_File(path, stream_handle, self)
+ self.audio_streams.append(stream)
+ return stream
+
+ def OpenMIDIStream (self, stream=None):
+ """Opens a MIDI stream.
+
+ Arguments:
+ stream - open stream object. If None, a new synth
+ is created.
+
+ Returns:
+ EAS_MIDIStream
+
+ """
+ with self.lock:
+ eas_logger.debug('Call EAS_OpenMIDIStream')
+ stream_handle = c_void_p(0)
+ if stream.handle is not None:
+ result = eas_dll.EAS_OpenMIDIStream(self.handle, byref(stream_handle), stream.handle)
+ else:
+ result = eas_dll.EAS_OpenMIDIStream(self.handle, byref(stream_handle), 0)
+ if result:
+ raise EAS_Exception(result, 'EAS_OpenMIDIStream error %d' % result, 'EAS_OpenMIDIStream')
+
+ # create stream object and save in list
+ stream = EAS_MIDIStream(stream_handle, self)
+ self.audio_streams.append(stream)
+ return stream
+
+ def OpenToneControlStream (self, path):
+ """Opens an MMAPI tone control file to be played by the EAS
+ library and returns an EAS_File object
+
+ Arguments:
+ path - path to audio file
+
+ Returns:
+ EAS_File
+
+ """
+ with self.lock:
+ eas_logger.debug('Call EAS_MMAPIToneControl for file: %s' % path)
+ stream_handle = c_void_p(0)
+ result = eas_dll.EAS_MMAPIToneControl(self.handle, path, byref(stream_handle))
+ if result:
+ raise EAS_Exception(result, 'EAS_MMAPIToneControl error %d on file %s' % (result, path), 'EAS_OpenToneControlStream')
+
+ # create file object and save in list
+ stream = EAS_File(path, stream_handle, self)
+ self.audio_streams.append(stream)
+ return stream
+
+ def Attach (self, stream):
+ """Attach a file or output device to the EAS output.
+
+ The stream object must support the following methods as
+ defined in the Python wave module:
+ close()
+ setparams()
+ writeframesraw()
+
+ Arguments:
+ stream - open wave object
+
+ """
+ self.output_streams.append(stream)
+ stream.setparams((self.config.numChannels, 2, self.config.sampleRate, 0, 'NONE', None))
+
+ def Detach (self, stream):
+ """Detach a file or output device from the EAS output. See
+ EAS.Attach for more details. It is the responsibility of
+ the caller to close the wave file or stream.
+
+ Arguments:
+ stream - open and attached wave object
+ """
+ self.output_streams.remove(stream)
+
+ def StartWave (self, dev_num=0, sampleRate=None, maxBufSize=None):
+ """Route the audio output to the indicated wave device. Note
+ that this can cause EASDLL.EAS_RenderWaveOut to return an
+ error code if all the output buffers are full. In this case,
+ the render thread should sleep a bit and try again.
+ Unfortunately, due to the nature of the MMSYSTEM interface,
+ there is no simple way to suspend the render thread.
+
+ """
+ if sampleRate == None:
+ sampleRate = self.config.sampleRate
+ if maxBufSize == None:
+ maxBufSize = self.config.mixBufferSize
+ with self.lock:
+ result = eas_dll.OpenWaveOutDevice(dev_num, sampleRate, maxBufSize)
+ if result:
+ raise EAS_Exception(result, 'OpenWaveOutDevice error %d' % result, 'OpenWaveOutDevice')
+
+ def StopWave (self):
+ """Stop routing audio output to the audio device."""
+ with self.lock:
+ result = eas_dll.CloseWaveOutDevice()
+ if result:
+ raise EAS_Exception(result, 'CloseWaveOutDevice error %d' % result, 'CloseWaveOutDevice')
+
+ def Render (self, count=None, secs=None):
+ """Calls EAS_Render to render audio.
+
+ Arguments
+ count - number of buffers to render
+ secs - number of seconds to render
+
+ If both count and secs are None, render a single buffer.
+
+ """
+
+ # determine number of buffers to render
+ if count is None:
+ if secs is not None:
+ count = int(secs * float(self.config.sampleRate) / float(self.buf_size) + 0.5)
+ else:
+ count = 1
+
+ # render buffers
+ eas_logger.debug('rendering %d buffers' % count)
+ samplesRendered = c_long(0)
+ with self.lock:
+ for c in range(count):
+ # render a buffer of audio
+ eas_logger.debug('rendering buffer')
+ while 1:
+ if self.aux_mixer is None:
+ result = eas_dll.EAS_RenderWaveOut(self.handle, byref(self.audio_buffer), self.buf_size, byref(samplesRendered))
+ else:
+ result = eas_dll.EAS_RenderAuxMixer(self.handle, byref(self.audio_buffer), byref(samplesRendered))
+
+ if result == 0:
+ break;
+ if result == EAS_BUFFER_FULL:
+ time.sleep(0.01)
+ else:
+ raise EAS_Exception(result, 'EAS_Render error %d' % result, 'EAS_Render')
+
+ # output to attached streams
+ for s in self.output_streams:
+ s.writeframesraw(self.audio_buffer)
+
+ def GetRenderTime (self):
+ """Get the render time in seconds."""
+ eas_logger.debug('Call EAS_GetRenderTime')
+ msecs = c_int(0)
+ with self.lock:
+ result = eas_dll.EAS_GetRenderTime(self.handle, byref(msecs))
+ if result:
+ raise EAS_Exception(result, 'EAS_GetRenderTime error %d' % result, 'EAS_GetRenderTime')
+ msecs = float(msecs.value) / 1000
+ eas_logger.debug('EAS_GetRenderTime: time=%.3f' % msecs)
+ return msecs
+
+ def SetVolume (self, volume):
+ """Set the master volume"""
+ eas_logger.debug('Call EAS_SetVolume: volume=%d' % volume)
+ with self.lock:
+ result = eas_dll.EAS_SetVolume(self.handle, 0, volume)
+ if result:
+ raise EAS_Exception(result, 'EAS_SetVolume error %d' % result, 'EAS_SetVolume')
+
+ def GetVolume (self):
+ """Get the stream volume."""
+ eas_logger.debug('Call EAS_GetVolume')
+ volume = c_int(0)
+ with self.lock:
+ result = eas_dll.EAS_GetVolume(self.handle, 0, byref(volume))
+ if result:
+ raise EAS_Exception(result, 'EAS_GetVolume error %d' % result, 'EAS_GetVolume')
+ eas_logger.debug('EAS_GetVolume: volume=%d' % volume.value)
+ return volume.value
+
+ def SetPolyphony (self, polyphony, synth_num=0):
+ """Set the polyphony of a synth."""
+ eas_logger.debug('Call EAS_SetSynthPolyphony: synth_num=%d, polyphony=%d' % (synth_num, polyphony))
+ with self.lock:
+ result = eas_dll.EAS_SetSynthPolyphony(self.handle, synth_num, polyphony)
+ if result:
+ raise EAS_Exception(result, 'EAS_SetSynthPolyphony error %d on synth %d' % (result, synth_num), 'EAS_SetPolyphony')
+
+ def GetPolyphony (self, synth_num=0):
+ """Get the polyphony of a synth."""
+ eas_logger.debug('Call EAS_GetSynthPolyphony: synth_num=%d' % synth_num)
+ polyphony = c_int(0)
+ with self.lock:
+ result = eas_dll.EAS_GetSynthPolyphony(self.handle, synth_num, byref(polyphony))
+ if result:
+ raise EAS_Exception(result, 'EAS_GetSynthPolyphony error %d on synth %d' % (result, synth_num), 'EAS_GetPolyphony')
+ eas_logger.debug('Call EAS_GetSynthPolyphony: synth_num=%d, polyphony=%d' % (synth_num, polyphony.value))
+ return polyphony.value
+
+ def SetMaxLoad (self, max_load):
+ """Set the maximum parser load."""
+ eas_logger.debug('Call EAS_SetMaxLoad: max_load=%d' % max_load)
+ with self.lock:
+ result = eas_dll.EAS_SetMaxLoad(self.handle, max_load)
+ if result:
+ raise EAS_Exception(result, 'EAS_SetMaxLoad error %d' % result, 'EAS_SetMaxLoad')
+
+ def SetParameter (self, module, param, value):
+ """Set a module parameter."""
+ eas_logger.debug('Call EAS_SetParameter: module=%d, param=%d, value=%d' % (module, param, value))
+ with self.lock:
+ result = eas_dll.EAS_SetParameter(self.handle, module, param, value)
+ if result:
+ raise EAS_Exception(result, 'EAS_SetParameter error %d (param=%d, value=%d)' % (result, param, value), 'EAS_SetParameter')
+
+ def GetParameter (self, module, param):
+ """Get the polyphony of a synth."""
+ eas_logger.debug('Call EAS_GetParameter: module=%d, param=%d' % (module, param))
+ value = c_int(0)
+ with self.lock:
+ result = eas_dll.EAS_GetParameter(self.handle, module, param, byref(value))
+ if result:
+ raise EAS_Exception(result, 'EAS_SetParameter error %d (param=%d)' % (result, param), 'EAS_GetParameter')
+ eas_logger.debug('Call EAS_SetParameter: module=%d, param=%d, value=%d' % (module, param, value.value))
+ return value.value
+
+ def SelectLib (self, test_lib=False):
+ eas_logger.debug('Call EAS_SelectLib: test_lib=%s' % test_lib)
+ easdll = cdll.LoadLibrary('EASDLL')
+ with self.lock:
+ result = eas_dll.EAS_SelectLib(self.handle, 0, test_lib)
+ if result:
+ raise EAS_Exception(result, 'EAS_SelectLib error %d' % result, 'EAS_SelectLib')
+
+ def LoadDLSCollection (self, path):
+ eas_logger.debug('Call EAS_LoadDLSCollection: lib_path=%s' % path)
+ with self.lock:
+ result = eas_dll.EAS_LoadDLSCollection(self.handle, 0, path)
+ if result:
+ raise EAS_Exception(result, 'EAS_LoadDLSCollection error %d lib %s' % (result, path), 'EAS_LoadDLSCollection')
+
+ def SetAuxMixerHook (self, aux_mixer):
+
+ # if aux mixer has bigger buffer, re-allocate buffer
+ if (aux_mixer is not None) and (aux_mixer.buf_size > self.config.mixBufferSize):
+ buf_size = aux_mixer.buf_size
+ else:
+ buf_size = self.config.mixBufferSize
+
+ # allocate audio buffer for rendering
+ AudioBufferType = c_ubyte * (2 * buf_size * self.config.numChannels)
+ self.audio_buffer = AudioBufferType()
+ self.buf_size = buf_size
+ self.aux_mixer = aux_mixer
+
+ def SetDebugLevel (self, level=3):
+ """Sets the EAS debug level."""
+ with self.lock:
+ eas_logger.debug('Call EAS_SetDebugLevel')
+ eas_dll.EAS_DLLSetDebugLevel(self.handle, level)
+
+#---------------------------------------------------------------
+# EASAuxMixer
+#---------------------------------------------------------------
+class EASAuxMixer (object):
+ def __init__ (self, eas=None, num_streams=3, sample_rate=44100, max_sample_rate=44100):
+ eas_logger.debug('EASAuxMixer.__init__')
+ self.Init(eas, num_streams, sample_rate, max_sample_rate)
+
+ def __del__ (self):
+ eas_logger.debug('EASAuxMixer.__del__')
+ self.Shutdown()
+
+ def Init (self, eas=None, num_streams=3, sample_rate=44100, max_sample_rate=44100):
+ """Initializes the EAS Auxilliary Mixer."""
+ eas_logger.debug('EASAuxMixer.Init')
+
+ if hasattr(self, 'eas'):
+ raise EAS_Exception(-1, 'EASAuxMixer already initialized', 'EASAuxMixer.Init')
+
+ # initialize EAS, if necessary
+ if eas is None:
+ eas_logger.debug('No EAS handle --- initializing EAS')
+ eas = EAS()
+ self.alloc_eas = True
+ else:
+ self.alloc_eas = False
+ self.eas = eas
+
+ # initialize library
+ eas_logger.debug('Call EAS_InitAuxMixer')
+ buf_size = c_int(0)
+ result = eas_dll.EAS_InitAuxMixer(eas.handle, num_streams, sample_rate, max_sample_rate, byref(buf_size))
+ if result:
+ raise EAS_Exception(result, 'EAS_InitAuxMixer error %d' % result, 'EAS_InitAuxMixer')
+ self.buf_size = buf_size.value
+ self.streams = []
+ eas.SetAuxMixerHook(self)
+
+ def Shutdown (self):
+ """Shuts down the EAS Auxilliary Mixer"""
+ eas_logger.debug('EASAuxMixer.Shutdown')
+ if not hasattr(self, 'eas'):
+ return
+
+ with self.eas.lock:
+ if len(self.streams):
+ eas_logger.warning('Stream was not closed before EAS_ShutdownAuxMixer')
+ for stream in self.streams:
+ self.CloseStream(stream)
+
+ self.eas.SetAuxMixerHook(None)
+
+ # shutdown library
+ eas_logger.debug('Call EAS_ShutdownAuxMixer')
+ result = eas_dll.EAS_ShutdownAuxMixer(self.eas.handle)
+ if result:
+ raise EAS_Exception(result, 'EAS_ShutdownAuxMixer error %d' % result, 'EAS_ShutdownAuxMixer')
+
+ # if we created the EAS reference here, shut it down
+ if self.alloc_eas:
+ self.eas.Shutdown()
+ self.alloc_eas = False
+ del self.eas
+
+ def OpenStream (self, decoder_func, inst_data, sample_rate, num_channels):
+ """Opens an audio file to be played by the JET library and
+ returns a JET_File object
+
+ Arguments:
+ callback - callback function to decode more audio
+
+ """
+ with self.eas.lock:
+ eas_logger.debug('Call EAS_OpenAudioStream')
+ decoder_func = EAS_DECODER_FUNC(decoder_func)
+ stream_handle = c_void_p(0)
+ result = eas_dll.EAS_OpenAudioStream(self.eas.handle, decoder_func, inst_data, sample_rate, num_channels, stream_handle)
+ if result:
+ raise EAS_Exception(result, 'EAS_OpenAudioStream error %d on file %s' % (result, path), 'EAS_OpenAudioStream')
+ self.streams.add(stream_handle)
+ return stream_handle
+
+ def CloseStream (self, stream_handle):
+ """Closes an open audio stream."""
+ with self.eas.lock:
+ eas_logger.debug('Call EAS_CloseAudioStream')
+ result = eas_dll.JET_CloseFile(self.eas.handle, stream_handle)
+ if result:
+ raise EAS_Exception(result, 'EAS_CloseAudioStream error %d' % result, 'EAS_CloseAudioStream')
+
+#---------------------------------------------------------------
+# JET_Status
+#---------------------------------------------------------------
+class JET_Status (Structure):
+ _fields_ = [('currentUserID', c_int),
+ ('segmentRepeatCount', c_int),
+ ('numQueuedSegments', c_int),
+ ('paused', c_int),
+ ('location', c_long),
+ ('currentPlayingSegment', c_int),
+ ('currentQueuedSegment', c_int),
+ ]
+
+#---------------------------------------------------------------
+# JET_File
+#---------------------------------------------------------------
+class JET_File (object):
+ def __init__ (self, handle, jet):
+ eas_logger.debug('JET_File.__init__')
+ self.handle = handle
+ self.jet = jet
+
+#---------------------------------------------------------------
+# JET
+#---------------------------------------------------------------
+class JET (object):
+ def __init__ (self, eas=None):
+ # eas_logger.debug('JET.__init__')
+ self.Init(eas)
+
+ def __del__ (self):
+ eas_logger.debug('JET.__del__')
+ self.Shutdown()
+
+ def Init (self, eas=None, config=None):
+ """Initializes the JET Library."""
+ # eas_logger.debug('JET.Init')
+
+ if hasattr(self, 'eas'):
+ raise EAS_Exception(-1, 'JET library already initialized', 'Jet.Init')
+
+ # create some members
+ if eas is None:
+ # eas_logger.debug('No EAS handle --- initializing EAS')
+ eas = EAS()
+ self.alloc_eas = True
+ else:
+ self.alloc_eas = False
+ self.eas = eas
+ self.fileOpen = False
+
+ # handle configuration
+ if config is None:
+ config_handle = c_void_p(0)
+ config_size = 0
+ else:
+ jet_config = S_JET_CONFIG()
+ jet_config.appLowNote = config.appLowNote
+ config_handle = c_void_p(jet_config)
+ config_size = jet_config.sizeof()
+
+ # initialize library
+ # eas_logger.debug('Call JET_Init')
+ result = eas_dll.JET_Init(eas.handle, config_handle, config_size)
+ if result:
+ raise EAS_Exception(result, 'JET_Init error %d' % result, 'JET_Init')
+
+ def Shutdown (self):
+ """Shuts down the JET library"""
+ eas_logger.debug('JET.Shutdown')
+ if not hasattr(self, 'eas'):
+ return
+
+ with self.eas.lock:
+ if self.fileOpen:
+ eas_logger.warning('Stream was not closed before JET_Shutdown')
+ self.CloseFile()
+
+ # shutdown library
+ eas_logger.debug('Call JET_Shutdown')
+ result = eas_dll.JET_Shutdown(self.eas.handle)
+ if result:
+ raise EAS_Exception(result, 'JET_Shutdown error %d' % result, 'JET_Shutdown')
+
+ # if we created the EAS reference here, shut it down
+ if self.alloc_eas:
+ self.eas.Shutdown()
+ self.alloc_eas = False
+ del self.eas
+
+ def OpenFile (self, path):
+ """Opens an audio file to be played by the JET library and
+ returns a JET_File object
+
+ Arguments:
+ path - path to audio file
+
+ """
+ with self.eas.lock:
+ eas_logger.debug('Call JET_OpenFile for file: %s' % path)
+ result = eas_dll.JET_OpenFile(self.eas.handle, path)
+ if result:
+ raise EAS_Exception(result, 'JET_OpenFile error %d on file %s' % (result, path), 'JET_OpenFile')
+
+ def CloseFile (self):
+ """Closes an open audio file."""
+ with self.eas.lock:
+ eas_logger.debug('Call JET_CloseFile')
+ result = eas_dll.JET_CloseFile(self.eas.handle)
+ if result:
+ raise EAS_Exception(result, 'JET_CloseFile error %d' % result, 'JET_CloseFile')
+
+ def QueueSegment (self, userID, seg_num, dls_num=-1, repeat=0, tranpose=0, mute_flags=0):
+ """Queue a segment for playback.
+
+ Arguments:
+ seg_num - segment number to queue
+ repeat - repeat count (-1=repeat forever, 0=no repeat, 1+ = play n+1 times)
+ tranpose - transpose amount (+/-12)
+
+ """
+ with self.eas.lock:
+ eas_logger.debug('Call JET_QueueSegment')
+ result = eas_dll.JET_QueueSegment(self.eas.handle, seg_num, dls_num, repeat, tranpose, mute_flags, userID)
+ if result:
+ raise EAS_Exception(result, 'JET_QueueSegment error %d' % result, 'JET_QueueSegment')
+
+ def Clear_Queue(self):
+ """Kills the queue."""
+ with self.eas.lock:
+ eas_logger.debug('Call JET_Clear_Queue')
+ result = eas_dll.JET_Clear_Queue(self.eas.handle)
+ if result:
+ raise EAS_Exception(result, 'JET_Clear_Queue error %d' % result, 'JET_Clear_Queue')
+
+ def GetAppEvent(self):
+ """Gets an App event."""
+ with self.eas.lock:
+ eas_logger.debug('Call JET_GetEvent')
+ result = eas_dll.JET_GetEvent(self.eas.handle, 0, 0)
+ return result
+
+ def Play(self):
+ """Starts JET playback."""
+ with self.eas.lock:
+ eas_logger.debug('Call JET_Play')
+ result = eas_dll.JET_Play(self.eas.handle)
+ if result:
+ raise EAS_Exception(result, 'JET_Play error %d' % result, 'JET_Play')
+
+ def Pause(self):
+ """Pauses JET playback."""
+ with self.eas.lock:
+ eas_logger.debug('Call JET_Pause')
+ result = eas_dll.JET_Pause(self.eas.handle)
+ if result:
+ raise EAS_Exception(result, 'JET_Pause error %d' % result, 'JET_Pause')
+
+ def Render (self, count=None, secs=None):
+ """Calls EAS_Render to render audio.
+
+ Arguments
+ count - number of buffers to render
+ secs - number of seconds to render
+
+ If both count and secs are None, render a single buffer.
+
+ """
+ # calls JET.Render
+ with self.eas.lock:
+ self.eas.Render(count, secs)
+
+ def Status (self):
+ """Get JET status."""
+ with self.eas.lock:
+ eas_logger.debug('Call JET_Status')
+ status = JET_Status()
+ result = eas_dll.JET_Status(self.eas.handle, byref(status))
+ if result:
+ raise EAS_Exception(result, 'JET_Status error %d' % result, 'JET_Status')
+ eas_logger.debug("currentUserID=%d, repeatCount=%d, numQueuedSegments=%d, paused=%d" %
+ (status.currentUserID, status.segmentRepeatCount, status.numQueuedSegments, status.paused))
+ return status
+
+ def SetVolume (self, volume):
+ """Set the JET volume"""
+ eas_logger.debug('Call JET_SetVolume')
+ with self.eas.lock:
+ result = eas_dll.JET_SetVolume(self.eas.handle, volume)
+ if result:
+ raise EAS_Exception(result, 'JET_SetVolume error %d' % result, 'JET_SetVolume')
+
+ def SetTransposition (self, transposition):
+ """Set the transposition of a stream."""
+ eas_logger.debug('Call JET_SetTransposition')
+ with self.eas.lock:
+ result = eas_dll.JET_SetTransposition(self.eas.handle, transposition)
+ if result:
+ raise EAS_Exception(result, 'JET_SetTransposition error %d' % result, 'JET_SetTransposition')
+
+ def TriggerClip (self, clipID):
+ """Trigger a clip in the current segment."""
+ eas_logger.debug('Call JET_TriggerClip')
+ with self.eas.lock:
+ result = eas_dll.JET_TriggerClip(self.eas.handle, clipID)
+ if result:
+ raise EAS_Exception(result, 'JET_SetTransposition error %d' % result, 'JET_TriggerClip')
+
+ def SetMuteFlag (self, track_num, mute, sync=True):
+ """Trigger a clip in the current segment."""
+ eas_logger.debug('Call JET_SetMuteFlag')
+ with self.eas.lock:
+ result = eas_dll.JET_SetMuteFlag(self.eas.handle, track_num, mute, sync)
+ if result:
+ raise EAS_Exception(result, 'JET_SetMuteFlag error %d' % result, 'JET_SetMuteFlag')
+
+ def SetMuteFlags (self, mute_flags, sync=True):
+ """Trigger a clip in the current segment."""
+ eas_logger.debug('Call JET_SetMuteFlags')
+ with self.eas.lock:
+ result = eas_dll.JET_SetMuteFlags(self.eas.handle, mute_flags, sync)
+ if result:
+ raise EAS_Exception(result, 'JET_SetMuteFlag error %d' % result, 'JET_SetMuteFlags')
+
+
diff --git a/jet_tools/JetCreator/img_Copy.py b/jet_tools/JetCreator/img_Copy.py
new file mode 100755
index 0000000..6df3f2e
--- /dev/null
+++ b/jet_tools/JetCreator/img_Copy.py
@@ -0,0 +1,51 @@
+#----------------------------------------------------------------------
+# This file was generated by C:\Python25\Lib\site-packages\wx-2.8-msw-unicode\wx\tools\img2py.py
+#
+from wx import ImageFromStream, BitmapFromImage, EmptyIcon
+import cStringIO, zlib
+
+
+def getData():
+ return zlib.decompress(
+'x\xda\x01\xd3\x02,\xfd\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00 \x00\
+\x00\x00 \x08\x06\x00\x00\x00szz\xf4\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\
+\x08d\x88\x00\x00\x02\x8aIDATX\x85\xcd\x97Mk\x13A\x18\xc7\xff\xcf\xce\xee\
+\x9a\xe0!9X\xfa\t\x92\x8dh\xfd\x06\x82\x07\x11z\n\xf8\x1dz\xd0[%\x8d"\x05O\
+\x966*\x05\xf1\x05\xf1\xe0I\xc5\xb3w\xa9\x96\xe2QQ\x0f\x01\xb5*B$x\xc8\x8b\
+\xdb$\xe6e\xc6C\xdc\xcd\xce\xb2\xb3/\xbaA\x1f\x08\x99\xd9\x99\x9d\xffo\xfe\
+\xcf3\x9b\r\xf0\x8f\x83\x00`{\xbbvn0\x1c-\xa6\xb9\xb0a\x18\xdf+\x17\xaa\xb7\
+\xa3\xe6\xe9\x000\x18\x8e\x16/U/\xa7\xa9\x8f\xcd\xda\xc6B\x9cy\xba\xb7\xd3n\
+\xb7S\x11\xcf\xe7\xf3\xb1\xe7j\xa9(\xfeE\xe8\xd1S\xe2\x07\xe7|>\x00\x8f\x9f<\
+<\xdf\xedvb\xe5\xd4\t"`\xb3v\xf5\x8aR\xd80\xdeVV\xab\'\x02\x01\xea\xf5\xba\
+\xd4\xefv;\x0b\x17\xd7\xd2-\xd2\xadk\x1bK\x80\xc2\x81R\xa9$\xf5\x9f\xef>\x03\
+\x90N\x91\x12\x11r\xb9\x9c\xdb\xff?\x8b\xd0\x9f\x82\xb4B\x08\x11\x0f@\x95\
+\x824\x84\xfd\x10\xa1\xa7@u\xac\x928\xe4\x08\n!P(\x14\xa0\xeb\xb2\xa42\x05ag\
+\xda\xefP\x98\xb0\x1f"\xd2\x01\xce9\x8a\xc5\xa2tmwo\'R0J8h<\x10\xc0\x0f\x13\
+\x14\xaa\x14\x84\tZ\x96\x15x\x8f\x04\xe0\x08&MA\xd8\xae\xfdcD\xa4\x06p \xfc)\
+\xd8{\xf9"\x10$\xae\xddsIA\\A`j\xbf\n\xc2\x05\xe0\x9c\xbb\x82a\xf6\x0b!\xdc|\
+F\xd9\xed|{\xdbD$\xad/\x01\xc4\x11\x8f#\x185?\x14\xc0\x1b\xfek\xce\x02\xaa\
+\x14D\xc1X\x96\x05"J\'\x05\x7fR\x80\x8c1\xf5\x930\xed\x14x\xc74M\x03c\xcc\
+\x05\xd0\xb4\xd9\x8f\xb0\x04\x90\xc9d$\x08\xefD\x7f1\xc5\xd9=\x11I\xc2N\xbb\
+\xf1\xad\x01\x011\x030L\xa3y\xeb\xceM\xe5\xff\x02\xa2\x19T\x12\xbb\x89\x08\
+\xf7\x1f\xdc\x83i\x9a\x00\x00\xd301\x1c\r\x91\xcdd\xa7\x8b:\x00\x95\xd5\xea]\
+\x9580}\xb7\xe3\x9c+m\x0e\xb3\x1b\x00N\x9f:\x03\xe7\xfe\xc1`\x80\xd7o^\x81@\
+\x8f\\\x808\x11\x04\xe0m\xab\xecf\x8c\x81s\x8eV\xab\x05!\x04>\xec\xbf\x87\
+\xdd\xb7;}\xfb\xe7Jb\x00\xd5\xaeU\xc2\xba\xae\x83s\x8e^\xaf\x07\xdb\xb6\xf1\
+\xe5\xebg\xf4\xfa?ZG\x8f/\x9d,/\x97{\x89\x00&\x93\t\xb2\xd9\xacT\x8cD\x04"\
+\x82\xa6i\xd2\x871\x06!\x04\x0e\x0el\x00\xc0\xfe\xa7\x8fh4\x1b\x02\x02;\x87\
+\x8e\x1c>[^.\xbbo\xb7\x14,\'\xc7\xf5\x1b[\xef\xc6\x93\xf1\xb1\xb8\xb0N\x88\
+\xdf\xb5\xaei\xac9\x16\x93\x95\xf5\xb5\xf5\xa7I\xd7\x98{\xfc\x02\\\xe5\x0c\
+\xee\x86\xfe\xecP\x00\x00\x00\x00IEND\xaeB`\x82h\xfd>s' )
+
+def getBitmap():
+ return BitmapFromImage(getImage())
+
+def getImage():
+ stream = cStringIO.StringIO(getData())
+ return ImageFromStream(stream)
+
+def getIcon():
+ icon = EmptyIcon()
+ icon.CopyFromBitmap(getBitmap())
+ return icon
+
diff --git a/jet_tools/JetCreator/img_Cut.py b/jet_tools/JetCreator/img_Cut.py
new file mode 100755
index 0000000..2ce5ca5
--- /dev/null
+++ b/jet_tools/JetCreator/img_Cut.py
@@ -0,0 +1,104 @@
+#----------------------------------------------------------------------
+# This file was generated by C:\Python25\Lib\site-packages\wx-2.8-msw-unicode\wx\tools\img2py.py
+#
+from wx import ImageFromStream, BitmapFromImage, EmptyIcon
+import cStringIO, zlib
+
+
+def getData():
+ return zlib.decompress(
+'x\xda\x01-\x08\xd2\xf7\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00 \x00\
+\x00\x00 \x08\x06\x00\x00\x00szz\xf4\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\
+\x08d\x88\x00\x00\x07\xe4IDATX\x85\xad\x97{PU\xc7\x1d\xc7\xbf\xbb{\xce\xb9\
+\x8fs/\xf7\x12^\x82T\xb8\x02Q\xab\xc18\nV\x1b\x9f\xa0M\x1f\x99\xb6\x7f\x946&\
+\x13;M\x94\xe9\xa4\x99vb\x0c\x125\xe6\x86\xd2\x82\x8f\x90L\x9264\xd3vR\x9b4\
+\xb1\xc9\xc4\xcc\xb4\xd3\xd6\x17\xad\xd1&\x05\xb5>\x88\x164 p\x91\xc7\xe5\
+\xa1\xf7r\x9f\xe7\xecn\xff\xc0\xeb\xe0\x03\x84iw\xe67\xe7\xcc\xd9\xdf~\x7f\
+\x9f\xf3\xdb\xfd\xed\xd9C0A{\xe9\xe5\xddU\xf1xl[$\x14wz\xbd\xde\x91\x89|om\
+\xbb_\xaa\xad3M\xf3\'*\xb3\xda7m\xda\x14\x19\xcf\x8f\x8e\xd7Q[[\x9b\xc59\x7f\
+:#=#\x96\xe4\xb2{\xa7\x12\xbc\xa6\xe6\xc5\xfb@HyZZzL\xc0\xdc4\x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32\x9f\x18\x94"yu\xc9\x83H\xec\x92$\x1cF\xef\xc7\
+G\r\xc7\x81\x86\xb2?\xf5\xf4\x88\xa9h*Sq~\xc3\x86E\xeaG\xef{\x06=y8u\xb2\x11\
+\xe6o\xeb\x119\xff\x19b\x83\x03\xb0\xc5c\xbat\xba\x9e\x07\xb0}*\x9a\xe4\xee.\
+\xa3\xad\x1eP\x15\x079\xbf sf\x9e:#\x97\xb4gg\xa1\xf7\x83\xbd\xc8w\xa5!\xdb\
+\x99\x02P\xe0\xe3\xce\x960\xe7r\xd6\xc6\x08|\x93\xd5\x1d7\x03o\x03\xc9\x92\
+\xd2\'UB\xd6q)\xb3A\xa0Q\x83)\x16\xc2\x88>0\x00\xe3\\S\x04 \x1fv\x04\x87\xbe\
+\x95\xa2\xeav\xcdb\x81\xc7\x9d\xaeu\x0e\x0f\x9c~\x97A\x95\x00e\x94v\x19\x9c\
+\xbf\xab\n\xf1Z\x1904\xe9\x0c\xbc\r|\x87P\xfa\xebT\x97K\xc9\xce\xc8\xb0\xb9t\
+\x1d\x12@\xdf\xd0\x10\xda|>X\xdc\xb6\xa8?6r\xc4\x19\x10\xdf\x0e:\xc9{\x19\
+\xba\xeb\xab\xd3T\xa7\xc5a\xb7\xa3y\xa8\x1bk\xe7\x15\x81\x00\x18\x0e\x04\xd0\
+\xe6\xf3E\xae\x0c\x0c\x98\xe0\xfc\x89u\xc0\xbe\xbb\x02\xfc\x81\xd2g(c/\x14\
+\xe6\xe5\xe9\x86i\xa2\xa3\xb7\xf7Z0\x1c\xd6\x18c\xea\xc29s\x94p$\x82\xcf:\
+\xda\xfbX\xdc\x9c^\x06\xf0\xd7\xd2\xe0\xb0G\xe9\xd1\x99\xee\xf4\xf9\x0e\xa8\
+\x94ZU\xb4uv\x07\xb8\x10$\xc5\xe9$3\xb3\xb3\x1d\x94R4]\xb8\x1029\xafz\xd84o:\
+\x1d\xddT\x86\xef\x00e\x84R\xef\xc2\xd9\xb3\xf5\xce\xde\xdeps[[\xd7\xf0\xc8\
+\xc8\xf7\x15!R\xa2\xdcx\xee|[\x1b2RR L\x91T\x06p\x00\xf8\x91\x1f#AU\xac\xbc<\
+\xd4\x0fS%h\xef\xba\x12\x88\xc5b\x0fs\xc3\x98\xdd;4\xb4\xe5_\xcd\xcd\xc3\x1d\
+==\xd1\xa5\x85\x85\xbaB\xe9\xf6\xdfS\xfa\xdd;\x02\xec\x03\\\x84\xd27\xe7\x17\
+\x14\xd8\xdb\xbb\xbb\xc3\x83\x81@\xa3[\x88\x82\xc7\x80\xfde@D\x13\xf8c8\x16\
+\x8b(\x8a\x02Hy\xd3\xda\xf9\xf1\x10\x02jDr]\xd7\x117\x0c\x85\x00\'\xd7\x01W\
+\x1e\x05^gBx\xae\xf8\xfd\xad\x97:;cEs\xe7\xea\n!\xbf\xda\x07\xdcs\x1b\x80Iiy\
+\xaa\xdb\xad\x00\xc0\xc0\xd5\xab#n!\x1e\xfc\x1a\x10K\xf4s`Y\xb2\xae\x1b\xc1P\
+\x08\nc\xed\xb7N\x9dBY\xbb\xce,p\xdal\xa6\x00V&\x9e\x97\x01\xd7\x98\x10\xcb\
+\xbb\xfd\xfe(\x01\x90\x95\x96\xa6\x1a\x94n\xbc\r\x80\x12\xb2>;=\xdd\xee\xeb\
+\xef\x0f\x9bB\xfctl\xf0z\xc0\xce\x18\xdbyonnRgOO\x94\x0b\xb1\xf7V\x00.\xc4\
+\xde\xae\x9e\x9e\xa8\'++\x89R\xba\xa7\x1e\xb0\x8f\x85\x90\xc0\xce\x8e\x9e\
+\x9e\xa8\';\xdb\xa62v\xe3\x88F\xc7\x08x\x1c\xba\x8eP8\x1c\'\xc0\xa9\xb1\xc1\
+\x93\x18;\x90\x99\x9a\xea\xd24\r>\xbf\xdf0\x84\xf8\xe5m\x19\x10\xe2\x17\xdd~\
+\xbf\xa1i\x1aR\\\xae\x14\'\xa5\x07\xc7Bp!\x9a\x82\xa1P\xd4\xe5t\xc2\xe4<\xf7\
+6\x00B\x88\t\x00\xba\xcd\xc6\x08P\xf8\x14\x90\xf4&\xb0\xce\xc1X[fj\xea\x82y\
+\x05\x05\xb6O\xce\x9c\t\rJ\xf9\xf4z@\x02H\x01\x90\x9a\xb02\x80\x0c\x00\x9bN\
+\xb7\xb6\x86f\xe5\xe4XS\xdd\xee\x05\x0eJ\xdb\xeb\x81u\x8f\x00I\x84\xd2\x85\
+\x0e]W)\xa5\x00pc\xbb\xbeQ\x86\xef)\xca\x87\x0599\xdfLq\xb9Hcss\xc8\xe4\x9c%\
+\xe9\xba1\xdb\xe3qZ5\r\xff<{6\xdck\x9a\xf5Oq\xfe\xc6up\x8a\x9b\xcbX\x02\x10u\
+\x8cm\x9c\xceX\xf9\xc2Y\xb3\xecQ\xc3@\x9b\xcf\x17\x0c\x84\xc3\x9a\xaa(\xa2d\
+\xf1b\xdbp O\x9c?\xff\xb7\xef\x19\xc67\x00\xf0\x84\x80R\x03\x14\xe40\xf6\
+\xe9\xac\xdc\\\xc7\x8ci\xd3\xa8\xaa(\x08\x8c\x8c\xa0\xbd\xbb;\xea\xf3\xfb\
+\xf9\x05)_\xa8\x12\xe2\x00\x00\x15\xa3;h\xc2\x18FK\xd2L\xd8s\x94\x96\xce\x03\
+\xb6g\xa5\xa51\xcf\xf4\xe9\xd6\x14\xb7\x1b\x00\xe0\xeb\xeb\x13\xffni\t^4\xcd\
+\x15\xcf\x03-\x00\x8c\xb1o@\xeb\x80\xc2tE\xd9CF\xffd(\x08\xe9\x1d\xe6|\xff\
+\xfbR\xeem\x00\x82\xd7\x83%\x8c\x8c19\xc68\x00\xbe\x0cp\x96\x11\xf2h\x8a\xa2\
+<D\x84\xc8\x04 $\xa5\xa7\xba\x0c\xe3\x99\n\xe0\xccuX9\xde\xc7(!Lo\tJ\xef`\
+\x899\x95c\xae\xfc\xfa}"3bL\xdfM\xed\xbfj\xaa\x81\xd8\x9f\'F\x8c\x00\x00\x00\
+\x00IEND\xaeB`\x82\x989\xee\xcb' )
+
+def getBitmap():
+ return BitmapFromImage(getImage())
+
+def getImage():
+ stream = cStringIO.StringIO(getData())
+ return ImageFromStream(stream)
+
+def getIcon():
+ icon = EmptyIcon()
+ icon.CopyFromBitmap(getBitmap())
+ return icon
+
diff --git a/jet_tools/JetCreator/img_Find.py b/jet_tools/JetCreator/img_Find.py
new file mode 100755
index 0000000..aafb0e6
--- /dev/null
+++ b/jet_tools/JetCreator/img_Find.py
@@ -0,0 +1,85 @@
+#----------------------------------------------------------------------
+# This file was generated by C:\Python25\Lib\site-packages\wx-2.8-msw-unicode\wx\tools\img2py.py
+#
+from wx import ImageFromStream, BitmapFromImage, EmptyIcon
+import cStringIO, zlib
+
+
+def getData():
+ return zlib.decompress(
+'x\xda\x01d\x06\x9b\xf9\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00 \x00\
+\x00\x00 \x08\x06\x00\x00\x00szz\xf4\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\
+\x08d\x88\x00\x00\x06\x1bIDATX\x85\xe5\x97kl\x93\xd7\x19\xc7\x7f\xe7\xbd\xf8\
+\x96\xc4vnNB.M(\xb1\r\x94\xc2(J\xc8F\xa9&Z\xb1\xa6\xd0\x0f\x05\x8a`Z\x99\x8a\
+\xa6\xa9\xd2\xbeL\xfb\xb0I\x93\x96i\x9a4i\x9a4M\x1a\x03\xa1J\x8b\x98\x986\
+\xc1\xc8\x9ai[\xfb%\x9d\xda\x02+YQK\xb2e\x8b\x93%C$\xe0\\\xb0\x9d\xf8\x12\
+\xbf\xd7} \xb6\x1cc\x93\x80\xf6m\x8f\xf4\xe8\xbc\xe7\xf8\xd5y~\xef\xff<\xcf9\
+\xc7\xf0\xffn\xa2x\xe0\xcc\x993\xaf)\x8a\xd2/IR\x95$IH\x92\x84eYX\x96\x85a\
+\x18\x98\xa6Y\xb2]oL\x08\xb1\xaci\xdaW\xfb\xfb\xfb\xaf<\x92\xe8\xec\xd9\xb31\
+\xd34m\xcb\xb2l\xcb\xb2lM\xd3\xf2\xcf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f\xd8\xdb\xf5y\xea\xea\xea\x88\xc7\xe3\x84\x83a\x02\r\
+\xf5;\x06~w\xe5\xe7\xc0\x91\xe2\x1c\xf0\n!\x96l\xdb\xc6\xeb\xf5\xe2\xf5z\xf1\
+\xf9|\xb8\xddn***\xf0x<8\x9d\xce\xfc\xbf%M\xd3H\xa7\xd3\xa4R)\x92\xc9$\x89D\
+\x82D"A<\x1e\'\x9dNs\xf4\xc8\xebl\xeex\x9a?\xbf\xfbG,\xcb\xa4\xa5\xb5\x99\
+\xb6\xcd\xcdtwwc\xc3\x8b\xb0\xb6\n\xaa\x80\xfa\x99\x99\x99\x1f\x9d:u\xea{B\
+\x08w\xf1\x97\xe7.\xac\xb9\x83\xa5\xd4s\xa1\x1a9\x97\x15\x89\xcbW.s\xec\xd81\
+\xda]m\x0c\x0f\x0fc\xdb\xf6G\x80\\\x98\x03N \x00\xd4\x02\xfe\xd5\xbe\\\xc4 \
+\x17\xb8\xb4\xearA+\n\xdc\x06\xacU\xcf\xb4?\xdd\xde\xbec\xfb\xf6\x13N\x973l\
+\x99\xe6\x07)c\xe5\xad\xf7\xdeyo\xba\xd4%\xce\t\xb8V\xdbr\x97<Q\x04P\x08\xb4\
+F\xb4U\xd7\x80,\x90\x062\xabc\x00\xfc\x17\x99SG\x06\x87\xbc\x16\xfb\x00\x00\
+\x00\x00IEND\xaeB`\x82\x8e\xd9\x1c{' )
+
+def getBitmap():
+ return BitmapFromImage(getImage())
+
+def getImage():
+ stream = cStringIO.StringIO(getData())
+ return ImageFromStream(stream)
+
+def getIcon():
+ icon = EmptyIcon()
+ icon.CopyFromBitmap(getBitmap())
+ return icon
+
diff --git a/jet_tools/JetCreator/img_New.py b/jet_tools/JetCreator/img_New.py
new file mode 100755
index 0000000..79a31ee
--- /dev/null
+++ b/jet_tools/JetCreator/img_New.py
@@ -0,0 +1,61 @@
+#----------------------------------------------------------------------
+# This file was generated by C:\Python25\Lib\site-packages\wx-2.8-msw-unicode\wx\tools\img2py.py
+#
+from wx import ImageFromStream, BitmapFromImage, EmptyIcon
+import cStringIO, zlib
+
+
+def getData():
+ return zlib.decompress(
+'x\xda\x01\xf1\x03\x0e\xfc\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00 \
+\x00\x00\x00 \x08\x06\x00\x00\x00szz\xf4\x00\x00\x00\x04sBIT\x08\x08\x08\x08\
+|\x08d\x88\x00\x00\x03\xa8IDATX\x85\xc5\x97\xcdN\x1bW\x14\xc7\x7f\xe7\xce\
+\xf5\x076\xb8@0\t\r\xd9T\x95\xca&\x8bnP\xd9t\xd5M\xb7}\x016\xac\xfa\x10\xddv\
+\xd9\x15\xddU\xea\x0b\xf4\r*e\xd1E%\xd4\xd0(HMhD]\xd2\x00\x01SC\x80\xf8s\xee\
+=]\x8cM\x8d=\xe31\x94*G\x1a\xcd\\\x8d\xe7\x9e\xdf\xf9\x9fs\xee\xf5\x85wl\xf2\
+\x7fL\xaaJ\x8e\xd3\xdc\x02\x19?\x8b\x0f&\x000\xaeA\xc7\xd4\x98n\xed\x8b\xd0N\
+\x04X__\xff\xc2Z\xfb\xbd1f\xca\x18\x831\x06\xef=\xde{\xc20\xc49\x17{\xef=O\
+\xe4\xdf0\xf3\xde\t\x93\xc53\n\x13\r\xac\xedt\xbf5\xad{\xf3\xc7\xdf~\xfa\xc9\
+\xce\x0f\xd0\xfc]JT\x01\xec \x801\xe6\xbb\xb5\xb5\xb5)\x91\x88-\x0cC\xac\xb5\
+\xdd\xc8t R\xbd\xfa\xac\xaf\x11\xfd\r\xd1\x1d\xd0W\xa0U\x84F\xf4N\x8a\xb9G\
+\x8f\xea_"\xd9\nhA\xb5\xf5X\x84\xda\x10\x80snZD\xa8T*\x88\x08\xce9\x8a\xc5"\
+\xedv\x9b\x1e\xd4\xe0=zn\x93\r\xb6\xc8\xdam\xac\xd9!c\xf7\t\xa4\x8aJ7\x03\
+\xd2f\xf1~=\x07\xb9\x87\x00\x9cK]\xb5\xf9\xf3\x10@/*\x11\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\xdcx\x00\xfd\x11\xa6\xb5g\x92\xa9\xeaeJS\x01\x06w\
+\xbd\x9e]wm\x18\xb5{&\x02\x84a\x18\xeb4\r(\x0e`\xd0\xc6V \xceq\xda:pS\x80\
+\xc4\x85\x08`cc\x03c\x86\x0bg\\@cLjm\x0c\xcd\x1e\x86\xe1e\xaeVVVFnLI\x8e\x93\
+\x14\x8a\xb3\x91)\x18\xdc\x9aG)\x11\xbf&\xa4\xdb\xc8\x14\x8c\xe34\xed]\x1aLl\
+\x17$\xb5\xe1M\xc0z\xcbz\x92\xddH\x81\xdb\xb4k\xed\x05iv\x13\xe5n\x04\xd0\
+\xdf\x19i \xaa:\x12l\x10\xa0$"g\xaaZ*\x95J\x88D\xe7\x02k\xed\x7f\xae\x0b\x80\
+l6{\x0e\xdc\x03N\x80\xd6 \xc0\x14P\xde\xdb\xdb\xfbzuu\xf5+\x91\xee\x89\xe2\
+\x96LU\x9b\xbb\xbb\xbb\xdf\x00\x0b@\x00\x1c\x00\xbe_\xc3\x1c0\x0f\xdc\x01\
+\xa6\xbb\xe3\xe0\x96\xfc7\x89\x82}\x0b\xd4\x80\xbf\x80\x0b\x88?\x1d\xe7\x80|\
+\xf7~[\xa7g\x07t\x88do\xd1\xf7?\xfd\x1fi[\xcc\xd5\x90zP\xe4\x00\x00\x00\x00I\
+END\xaeB`\x82\xd34\xc5\xd2' )
+
+def getBitmap():
+ return BitmapFromImage(getImage())
+
+def getImage():
+ stream = cStringIO.StringIO(getData())
+ return ImageFromStream(stream)
+
+def getIcon():
+ icon = EmptyIcon()
+ icon.CopyFromBitmap(getBitmap())
+ return icon
+
diff --git a/jet_tools/JetCreator/img_Open.py b/jet_tools/JetCreator/img_Open.py
new file mode 100755
index 0000000..7a1fe25
--- /dev/null
+++ b/jet_tools/JetCreator/img_Open.py
@@ -0,0 +1,79 @@
+#----------------------------------------------------------------------
+# This file was generated by C:\Python25\Lib\site-packages\wx-2.8-msw-unicode\wx\tools\img2py.py
+#
+from wx import ImageFromStream, BitmapFromImage, EmptyIcon
+import cStringIO, zlib
+
+
+def getData():
+ return zlib.decompress(
+'x\xda\x01\x96\x05i\xfa\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00 \x00\
+\x00\x00 \x08\x06\x00\x00\x00szz\xf4\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\
+\x08d\x88\x00\x00\x05MIDATX\x85\xed\x96Ol\x13\xd9\x1d\xc7?ofl\'v\xb6\x0eN\
+\x1c\xa5E\x02\xad@P$\x96C\xb47\n\xe5\x92Ks\xe1\x88\xb6R9\xf5\xc4\xa9\xf7\x82\
+\x84\xf6\x80\xe8\xb5\x87\xaa\x08\xf5\x86\xca\xa1Zi\x0fU\xa5\xa5\xda\xf6\xd0U\
+\xcb\x8av\xd5\x06*6 \xc7I\x086\x8e\'x<\xf6\x8cg\xe6\xfd\xe9!\xb1\xeb\xb1M \
+\xab\xaa\xbd\xf4;\x1a\xbd\xf7~\xbf7\xef\xfb\xfd\xfd\xde{\xf3\x1e\xfc\x8f!\
+\x0er\xae\xac\xac\xfc\x00\xf8m&\x93\xe9\x8e\xf6\xb5,\x0b\xdb\xb6\xb1m[\xd8\
+\xb6\x8d\xe38\xfd6\x96eaY\x96\rd\x87m\xc3\xe5\xad[\xb7\x04\x80s\xa0:!\xbe\
+\x9c\x9e\x9e\xe6\xfe\xfd\xfb\x05)%\xc6\x18\x00\x8c1\x83\xb7\x8f\xd1\xb6eYd2\
+\x99\xd4x}\xff\xf5\xeb\xd7\x076\x07\xe0\xea\xd5\xab\x7fL\x92\xe4\xfb\x93D\
+\x84a8,(U\xbe\r\xc3\x82\xfaPJ\xa1\xb5V)\x01I\x92\x9c\xbfq\xe3\x06\xadV+\x15\
+\x811\x86\xdb\xb7o\x03\xe0\xba.\x0f\x1e<x\'\xe2I8}\xfa4\xe7\xce\x9d\xc3\xf7}\
+\x84\x10\x9d\x94\x00\xdb\xb6_W\xab\xd5\xf2\xf3\xe7\xcfS\x1f\x05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B`\x82\x8f\x9d\xc6\xf3' )
+
+def getBitmap():
+ return BitmapFromImage(getImage())
+
+def getImage():
+ stream = cStringIO.StringIO(getData())
+ return ImageFromStream(stream)
+
+def getIcon():
+ icon = EmptyIcon()
+ icon.CopyFromBitmap(getBitmap())
+ return icon
+
diff --git a/jet_tools/JetCreator/img_Paste.py b/jet_tools/JetCreator/img_Paste.py
new file mode 100755
index 0000000..842c4a7
--- /dev/null
+++ b/jet_tools/JetCreator/img_Paste.py
@@ -0,0 +1,41 @@
+#----------------------------------------------------------------------
+# This file was generated by C:\Python25\Lib\site-packages\wx-2.8-msw-unicode\wx\tools\img2py.py
+#
+from wx import ImageFromStream, BitmapFromImage, EmptyIcon
+import cStringIO, zlib
+
+
+def getData():
+ return zlib.decompress(
+'x\xda\x01\xdd\x01"\xfe\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00 \x00\
+\x00\x00 \x08\x06\x00\x00\x00szz\xf4\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\
+\x08d\x88\x00\x00\x01\x94IDATX\x85\xed\x97\xbdN\xc30\x14\x85OJ\x06gK6\x18;\
+\xa6\x1bk^\xa1\x8fS\xb5\x08\x18\x10\x03c\x07\x84X\x902\xb6o\x90\x951\xdd\xca\
+\xd6\x8c\x1e\x93\xcd\x06\x06\xdf\xad\x0c\xb4\x15HIs\x9dDD\x958[,\xfb\x9e/\
+\xbe\xd7\x7f\x8e38C\x9fr\x01\xe0\xe9\xe5qKZw\x1cZ`:\xbbrX\x00\xa45&\x93\xdbN\
+\xed\xe7\xf3\x07V?\xf7\xe7\x87\xeeh\x16|\xdfg\xf7\x1dt\xe2\xd8B\xff\x00nYc\
+\x96e\x8d\x82\r\x87C\x08!\xda\x03\x84a\xd8\x08\xa0\x89N#\x05i\x9aB)\xb2\x0e~\
+s}\xbf\x05\x80 \x00\xa6\xb3\xbb\xd2M\x89\x95\x82$y\x85\x94\xd6\xfe,\x9dF\n\
+\xfe\x1c\xa0,\x05{\x8dF\xe7\x10\xc2\xab\rLd\xb0\xd9\x14\xcd\x00\x8e\xc9\x18\
+\x821\x9c\x9e\xbc\xa2\xb5N\x81\xd6\xc4\nN\xccUS\x99\x02\xa2\xf2\x00ax\xc1\
+\xda\xedV+\t\x98z\x88R\x80*s\x00H\xd3n\xd7\xe3/\x80c\xc6{\x8d\xc7\x97\xa8\
+\x9b\x80\xf5ZBJ\xde\xdd\xc2\xba\x08\x93\xe4\xcdv\x08\x0f\x80\xf3\xf7\x00\x10\
+E\xbc\x13\x8f\x88X\xe9\xb2\x9e\x81,\xcbm\x87t\x0b\xd0\xe4Pb\x01\x10\x91\xf5e\
+\xa2L\x9e\x07\xf8>v\x85*vm\xd5\xd0;\x00\x818~nm\x0e|\x1bGQx\xb8\x19\x17E\x81\
+<\xaf\xae\x05\x17@\xed\x03b\x7f\xae\xf3!\xc4\xc1\\)\x05)\xab\xeb\xc6\xba\x06\
+8\xd2Z\xc3\x18\x03M\x1aRJ,\x16\x8bv\x00A\xc07\xf7< \xcfs(RX\xc6K(\xa5\xf0\
+\xfe\xf1Y9\xc3N\xdf\x8f\xd3\xdeoD\xbd\x03|\x01\xd0i\x97\xf5j]\xc4\xe0\x00\
+\x00\x00\x00IEND\xaeB`\x82q\x05\xc6\xef' )
+
+def getBitmap():
+ return BitmapFromImage(getImage())
+
+def getImage():
+ stream = cStringIO.StringIO(getData())
+ return ImageFromStream(stream)
+
+def getIcon():
+ icon = EmptyIcon()
+ icon.CopyFromBitmap(getBitmap())
+ return icon
+
diff --git a/jet_tools/JetCreator/img_Print.py b/jet_tools/JetCreator/img_Print.py
new file mode 100755
index 0000000..cf2e00d
--- /dev/null
+++ b/jet_tools/JetCreator/img_Print.py
@@ -0,0 +1,62 @@
+#----------------------------------------------------------------------
+# This file was generated by C:\Python25\Lib\site-packages\wx-2.8-msw-unicode\wx\tools\img2py.py
+#
+from wx import ImageFromStream, BitmapFromImage, EmptyIcon
+import cStringIO, zlib
+
+
+def getData():
+ return zlib.decompress(
+'x\xda\x01\xf5\x03\n\xfc\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00 \x00\
+\x00\x00 \x08\x06\x00\x00\x00szz\xf4\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\
+\x08d\x88\x00\x00\x03\xacIDATX\x85\xe5\x97\xcfK+W\x14\xc7?\x93d\x921&5\xc4TD\
+\x9fZ4\xb8x\xbc\x85F\xe9?P\xca\xdb\n\xee\xdd\xd5TT\xac\xbb\x16\xe9+B\x97>\
+\xa5.Z(B\xb7.\xba.v\xe9>\x1b\x17\x82P\x8a\xf8\xe3\x11SS\x13\'\xc6\x9a\x99;s\
+\xbbp2L\x12\x7f\xcc3\xb6]\xf4\x0b\x87\xdc{\xee\x99s\xbe|\xcf\xbdw&\xf0\x7f\
+\x87r\xdf\xc2\xc6\xc6\xc6\x0f\x86a\xcc\x02\x816k\xd8\xe1p\xf8\xc7\xe5\xe5\
+\xe5\xb9\xbb\x16C\xf7=e\x9a\xe6\xec\xd2\xd2R\xbb\xc5\x01\x02\x9b\x9b\x9b\xb3\
+\xc0\xfb\x11\x90R\x06\x00\xce\xce\xce\xda\xaa\xde\xdb\xdb\xeb\xe6z/\x02^\x9c\
+\x9c\x9c\xdc\xe9\x17BP*\x95H\xa5R(Jc7\x07\x06\x06|\x11|\x94\x80\xaa\xaa\x0c\
+\x0f\x0f\xdfY|oo\x8fZ\xad\x86\x10\x82\xd1\xd1Q_\x05\x9fD\xe0\xf8\xf8\x18\x00\
+)\xa5\xeb\xcf\xe7\xf3T\xabU\x00\n\x85\x02\x00\xf1x\xdc]\x1f\x1c\x1c|\x1e\x02\
+\xa1P\xa8E\x81\x83\x83\x03\xb7x\x1d\xe7\xe7\xe7\xa4\xd3ib\xb1\x98\xeb\xf3\
+\x12~2\x01UU9::r\xe7\xa5R\x89\xd3\xd3\xd3\x968\xdb\xb6\xc9\xe5r\x8c\x8c\x8c\
+\x10\x08\x04\x18\x1a\x1az\xb4\xb8o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ec\xec\xfc\x8a\x10&/\
+\xfa\xfb\xd14\x8dpX\xf5X\x98p$L\xa4\xc1"D"\x114\xcdk\x1aZ\x87F\x87c\x00\xbb\
+\xbb\xbb\x00\x18\xa6\xd1@\xa0E\x81\xbe\xbe>\xbe~\xf3\r\xa6i6\x04\xd6\xf7\xf8\
+\xe3\xaf\x97V\xa8\xaa\xca\xabW/o\t\x18\x0f\x10\xb0m\x8b\x89\x89\x0c\x99\xcc8\
+RJl\xdbv\xfa\xef\x19\xdb6\xb6\xe3\x93\x8e\xcf\xf63v~\xcd&\x02--\xf8\xa7a4)\
+\xfb\xef\x13\xf8\xaf\x15hnA}\x0fD\x02\x81\x80Q\xa9\xe8\xe1h4\xea\xe9\xbbs\
+\xde\xbdc\xdb{\x0f8{\xc1\xcfX\xdaH\t\xba~\x89\xa2(\x16\x90\x04\xca!G\x85\xae\
+j\xb5\xfa\xfd\xdb\xb7\x1b_\xf8\xf9\x8cj\x07\x8a\xa2P.\x97\x7fr\x08H\xc5Q\xa1\
+\x1bH\xbd~\xfd\xe9|w\xf7\x87\x9fI)}}\xae?\x01V\xa9T\xfaygg\xe7;\xe0O\xa0P?\
+\xde\x9a\xc3\xa8\x0b\x88:\xa4\x9e\xe3_\x91\x17\xa6\x93\xd3\x04\xae\x80s\xe0\
+\xb2\xf9\x05\xaf\x02a \xf2\xcc\xc5\x01,\xc7L\xc0\xe0iw\xda\xf3\xe3o\xfe\xfdT\
+R\xd6\x04\xb1Y\x00\x00\x00\x00IEND\xaeB`\x829\x9b\xe7\xcb' )
+
+def getBitmap():
+ return BitmapFromImage(getImage())
+
+def getImage():
+ stream = cStringIO.StringIO(getData())
+ return ImageFromStream(stream)
+
+def getIcon():
+ icon = EmptyIcon()
+ icon.CopyFromBitmap(getBitmap())
+ return icon
+
diff --git a/jet_tools/JetCreator/img_Redo.py b/jet_tools/JetCreator/img_Redo.py
new file mode 100755
index 0000000..10624f4
--- /dev/null
+++ b/jet_tools/JetCreator/img_Redo.py
@@ -0,0 +1,79 @@
+#----------------------------------------------------------------------
+# This file was generated by C:\Python25\Lib\site-packages\wx-2.8-msw-unicode\wx\tools\img2py.py
+#
+from wx import ImageFromStream, BitmapFromImage, EmptyIcon
+import cStringIO, zlib
+
+
+def getData():
+ return zlib.decompress(
+'x\xda\x01\xb6\x05I\xfa\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00 \x00\
+\x00\x00 \x08\x06\x00\x00\x00szz\xf4\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\
+\x08d\x88\x00\x00\x05mIDATX\x85\xd5\x95Yl\x94U\x14\xc7\xff\xf7~\xcb,\xdd\xe8\
+\x12JK+\xb4bE\x8a .mR7\x12\x16\x83\x0eBb\x9a\x10\x83\xf1\x05\xa1\xf0\xe2\x93\
+>\xca\x83/\x9a\xa8\xf1\xc1\x18[\x9e \x06\x03\x06\x0cK\x13pCQD\xa0-\x96\xb6`)\
+HK;\xa5e:\xcct\xda\x99\xf9\x96\xbb\xf8\xd0\xce\xf81|C\x01\x93\x1a\xcf\xe4\
+\xe4\xdc;\xdf\xbd\xf7\xff\xbb\xe7\x9c\x99\x0f\xf8\xbf\xdb\xfa\x16\xed\xd3\
+\x9d;A\x1ft\xff\x03o\xfc\xc7\xc8\x8e\xceJ\xedx\xe3\xc7\xf0\xfd\'\x00\x04 K\
+\xab\x1a^\xb0\x0b\xf43\x81f\x94\xcc:\x00\x00\xd4-^\xa5\xd7\xd7\xae^\xa2P\xad\
+sc\xb3\xe7\xe1Y\x07\xa0D\xc1\xe2\xca\'\x94UOn\x9c\'(\xda\x02\xcd\xea3\xb3\
+\x06@@@\xa1"l\x0f\xa0\xbct!\r4l\x9a\xa3Q\xfd\xc4\xfa\x16=0;\x00\x84\x80\x12\
+\n\x02\x8a\x885\x88\x82\xfcBlx\xf1\x8d\x1c\xaf\xee\xd9\xf7j\x8b\xda4\xf3\x05\
+\xee\xc3\x02\xcd\xf0\x03\xfaZ\xaa`\x13\x01\x9e\x86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b6f\x9b\xd1\xfe\x06%@\xa0\xd7\xa5<\xcc\xbe\x00\x00\x00\
+\x00IEND\xaeB`\x82\xe2\xa8\xb4\xdb' )
+
+def getBitmap():
+ return BitmapFromImage(getImage())
+
+def getImage():
+ stream = cStringIO.StringIO(getData())
+ return ImageFromStream(stream)
+
+def getIcon():
+ icon = EmptyIcon()
+ icon.CopyFromBitmap(getBitmap())
+ return icon
+
diff --git a/jet_tools/JetCreator/img_Save.py b/jet_tools/JetCreator/img_Save.py
new file mode 100755
index 0000000..9e19146
--- /dev/null
+++ b/jet_tools/JetCreator/img_Save.py
@@ -0,0 +1,99 @@
+#----------------------------------------------------------------------
+# This file was generated by C:\Python25\Lib\site-packages\wx-2.8-msw-unicode\wx\tools\img2py.py
+#
+from wx import ImageFromStream, BitmapFromImage, EmptyIcon
+import cStringIO, zlib
+
+
+def getData():
+ return zlib.decompress(
+'x\xda\x01\xb3\x07L\xf8\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00 \x00\
+\x00\x00 \x08\x06\x00\x00\x00szz\xf4\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\
+\x08d\x88\x00\x00\x07jIDATX\x85\xc5\x97}l\x14\xc7\x15\xc0\x7f3\xbb\xf7\xe1\
+\xb3\xcf\x17\x1f\x0e&\xfe\xc06N\x1cc\x02D\xb81\xf9\xc0\xd0\xf0i\xd2\x98P\x82\
+\xd34*\x89PR\xaa\xf4\x9fTj\xaaP%-j\x155\x91h*\xf5\x8fV*\x8d\xfa\x0fU\xd5D\
+\xa5Q\x9aF!T\x90\x94\xb4I\xaa\x94&\x18T\x01&\xe5\xcb\x18\xf7(\xf6\xf9|\xbb\
+\xbe\xdb\xdd\x99\xe9\x1f\xe6\xb6\xb6\x81\xd0(T\x1d\xe9ig\xe6\xcd\xce\xfb\xed\
+{o\xdf\xec\xc2\xff\xb9\x89\xab-h\xfe\xc2\xf3\x9d\x1a\xf1\x15)X\n"j\xc0A\xe9w\
+\x8c\xe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\xd6z\xfa\xe9v\xd9\xb9\xffv-@mmm\x08\x1b>R\x89\x08\xe0\x83\x0f>\xa0\
+\xaf\xaf\x8f\xfe\xfe~\x06\x06\x06\xc8d2d\xb3Y\x1c\xc7\xa1X,\x86E\xa6T\xe5\
+\x8c1\x0c\x0f\x0f\xd3\xd0\xd0@6\x9b\xa5\xa1\xa1\x81\x91\x91\x11f\xcf\x9eM6\
+\x9b\xa5\xa9\xa9)\xbcN\xb7\x15\x02LvW)\xeeWj\x97s\xfbt\xdd\x95\xc2\x01\xa0\
+\x94\xfad\x0f\xc4b\xb1)\xf1\xfe$\x90\xe9\x9bO\xd7]\xaeM\xb6\x15\xe6@\x89\xca\
+\x18C{{;J\xa9\xb0\x84\x96\\\xae\x94B\x081\xa5\xce_\rf\xfa\\\xe9\xd56\xc6\xe8\
+\x10\xc0\x18s\xf2\xd4\xa9SM7\xdf|s\x988\xa5\xe4)\xf5\xaf&uuuh\xadioo\xc7\xf3\
+<\xda\xda\xda(\x14\n\xb4\xb6\xb6\xe28\x0e---\xe4r9R\xa9\x14\x83\x83\x83\x18c\
+\x8e\x02q\x1b\xc0u\xddoo\xdf\xbe}\xbbeY\xf5W\xf5\xfb5hA\x10\x0cd2\x99\xe7\
+\x80h\xa9Z\xc4\x81\x19@\x15P\tD\x81\xc85\xb6\xeb1\xf1#T\x00r\xc0y\xe0\xfc\
+\xe4\xcfr\x01\x94_\x948\x97\xf9k\xfa\x8c-\xb8(\x05 \x7f\x11\x88\x7f\x03\xca\
+\x8e`}\xd3\xc8\x9b>\x00\x00\x00\x00IEND\xaeB`\x82\xfca\xccs' )
+
+def getBitmap():
+ return BitmapFromImage(getImage())
+
+def getImage():
+ stream = cStringIO.StringIO(getData())
+ return ImageFromStream(stream)
+
+def getIcon():
+ icon = EmptyIcon()
+ icon.CopyFromBitmap(getBitmap())
+ return icon
+
diff --git a/jet_tools/JetCreator/img_Undo.py b/jet_tools/JetCreator/img_Undo.py
new file mode 100755
index 0000000..d5339a4
--- /dev/null
+++ b/jet_tools/JetCreator/img_Undo.py
@@ -0,0 +1,81 @@
+#----------------------------------------------------------------------
+# This file was generated by C:\Python25\Lib\site-packages\wx-2.8-msw-unicode\wx\tools\img2py.py
+#
+from wx import ImageFromStream, BitmapFromImage, EmptyIcon
+import cStringIO, zlib
+
+
+def getData():
+ return zlib.decompress(
+'x\xda\x01\xf3\x05\x0c\xfa\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00 \
+\x00\x00\x00 \x08\x06\x00\x00\x00szz\xf4\x00\x00\x00\x04sBIT\x08\x08\x08\x08\
+|\x08d\x88\x00\x00\x05\xaaIDATX\x85\xd5\x97klT\xc7\x15\xc7\x7fs\xef\xdd\xf5\
+\xda^\xdb\x18;\x88\xf2\x067\x01\x1a\'$\xc4T\x8aM)\xc1\xc9\x07\xac\xa8\xe9\
+\x87\x88$R\xe2\x00!\tAj\x91"%RZ\xa2\xaa\x8f\xa8\xfd\x10\xa9B\xfeDKx\xb6Q\xde\
+o\xa1\xa0\xe6\x81\x8c\r\x08\xec\x90\xd4\xe088\x10\xe3\x801v\xec]\xaf\xf7u\
+\x1f3\xd3\x0f\xf6\xdd\x98\xcdbl\x17U\xea\x91\x8ef\xee\xee\x99\xf9\xff\xee\
+\xcc9s\xef\x85\xffW\xd3\x1a\xd1\xb4\x9b?\xb6\xec\xa0\xe4\xbf\x99GLe\xd0\xb1\
+\xfd\x14+\xcd[JQ\xebjJ\xef\xda@t\xaa\x00\xc6d\x074\xee\xe5&\xa5E\xdb\x9c\x9b\
+\x1fX%\x0c\xcb\x99\xaa\xf0\x94\x00\x9avQgY\x85\x9f\xddX\xfd\x9b\xb93\x16\xfd\
+"\x80@\xff\xcf\x00\x9a\xf7\xf2|h\xda\x827+k_,,,\x0e\x8b)\xee\xde\x0f\xcc\xba\
+V\xc0\xc1}\x14\x16\xc1+\xa5\xb3\xd6\xdc=\x7f\xf9\x93!\xed\xb6#\xed\xaf1\x82\
+\x0b\xb9\x1e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}:V\xc5l\x82\
+\x95\x8b(\xbca&\xf9\xf9`y\xe0\xf5v\x13oj#\xd6\xda\x81\x9d%\xa8\xb3@\xa4\x9f7\
+\xb9\x0e\x92\tUA\x8e\xb1c\x13\xd1\x17\xccn=\xb2\xce\xefk\xbd[\x8f\x0706f\xac\
+\xb8\xdff\xaf\xc0U\x05&kW\x13\xf7mR\x9fk\xff\x01\xb0\x15\x95\x01\xe1\xb3\xd2\
+\x81\x00\x00\x00\x00IEND\xaeB`\x825\x1a\xdc\x86' )
+
+def getBitmap():
+ return BitmapFromImage(getImage())
+
+def getImage():
+ stream = cStringIO.StringIO(getData())
+ return ImageFromStream(stream)
+
+def getIcon():
+ icon = EmptyIcon()
+ icon.CopyFromBitmap(getBitmap())
+ return icon
+
diff --git a/jet_tools/JetCreator/img_favicon.py b/jet_tools/JetCreator/img_favicon.py
new file mode 100755
index 0000000..39b2dde
--- /dev/null
+++ b/jet_tools/JetCreator/img_favicon.py
@@ -0,0 +1,61 @@
+#----------------------------------------------------------------------
+# This file was generated by C:\Python25\Lib\site-packages\wx-2.8-msw-unicode\wx\tools\img2py.py
+#
+from wx import ImageFromStream, BitmapFromImage, EmptyIcon
+import cStringIO, zlib
+
+
+def getData():
+ return zlib.decompress(
+'x\xda\x01\xd4\x03+\xfc\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00 \x00\
+\x00\x00 \x08\x06\x00\x00\x00szz\xf4\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\
+\x08d\x88\x00\x00\x03\x8bIDATX\x85\xc5\x97klSe\x18\xc7\x7f\xef9\xed\xda\xb5\
+\xdd\xa8\xeb\xec\x9cd\xc9\xe6\xb0&\x18#\xc6(\xd1\xb0(\n\x0eG\xb8\x05GLX\xe2\
+\x17\xa3\x04\xd4hP\x13t&\x98\r\xbf\x90h\xe2\x06Y\xf8`d\x18!r\t\xa0f\xb0\xa0s\
+\xea\xbc\x8d\xc5!c\x85Ywi\xe9\xd8\xad[\xa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9c\x00"\
+\xb1i.\xfc0\xc2\xb47\x81\xb9PK\xaeIFgT\x99\xf4\r\xb38g5O\x94\xd5%\xedt\xa9$\
+\x84$\'\xfd9U\xd58\xcfTo\xa6\xed\x97S\xac\xaa\xc9gQA\x0e\t\xc5\xc4\xf2{\xb6P\
+S\xf5.\x06c\xf2:O\x1b`F\xad\xe7\xce`\xef\xbdLiY\t\x8f<\xfc\x18\xd6\xa2\xc2\
+\xb4\x16\x9e\xd1_\xa4\x9cO6P\x7f\x0e\x9e\x00\x00\x00\x00IEND\xaeB`\x82\x80\
+\xab\xe3<' )
+
+def getBitmap():
+ return BitmapFromImage(getImage())
+
+def getImage():
+ stream = cStringIO.StringIO(getData())
+ return ImageFromStream(stream)
+
+def getIcon():
+ icon = EmptyIcon()
+ icon.CopyFromBitmap(getBitmap())
+ return icon
+
diff --git a/jet_tools/JetCreator/img_splash.py b/jet_tools/JetCreator/img_splash.py
new file mode 100755
index 0000000..beb94a9
--- /dev/null
+++ b/jet_tools/JetCreator/img_splash.py
@@ -0,0 +1,1157 @@
+#----------------------------------------------------------------------
+# This file was generated by C:\Python25\Lib\site-packages\wx-2.8-msw-unicode\wx\tools\img2py.py
+#
+from wx import ImageFromStream, BitmapFromImage, EmptyIcon
+import cStringIO, zlib
+
+
+def getData():
+ return zlib.decompress(
+'x\xda\xbc\x9b\xe3s%\xbe\x1f\xefOmlmlm\xb7[\xdb\xc6\xd9\xb6[\xebT[\xdb\xb6\
+\xdd\x9e\xda\xb6vk\xdb\xc6\xd6\xb6\xad\xfb\xfd=\xb8\x7f\xc2\xbd\x0f2\xc9d&\
+\xc9L\xf0\xce\xfb\x95\xf9$BEI\x1a\x05\x91\x00\x11\x00\x00\xa0\xc8\xcaH\xa8\
+\x01\x00\x10,\xff\xa5\xef\xf0\x90\xff\xd5\xd0|\xefW\xfd/\x83r\x12\x93\xd5\
+\x80\x87\x87_\xdfQ\xde\x06\x00\xc8\x00\xb2\x12\xa2\x1a\xeeY\xe7\x9dn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9\xec\x98h\xaf\x9e\x0f\xcb\xf0\xb4\x06K\x19i\xe5\xa0yJ\
+F\xc4\xdb"#\x12{I8&\xe3-Ny\x17\xe1\x93`T\x85\x98\x90\x08\x06\xf6\xbdj\xfbD\n\
+\xdb\x04\xef\xf6T^\x7f(\x86f\xe8\x1d\xb9\xa7\xc0\xab\x9dE\x03\x06\x18\x06,\
+\x84\tJ\x9d\x00$\xe4\x85\xed\x08\xb0\xbd\xd1D\x00\xbc\x19\xab\x15\xdd)\x90z"\
+\xe0x\x88j/\x18\x0bO\xa2\xde\x97\x10\xff\xee$\xaa\xb0\x80n2,eW)f\xe7F@\x99\
+\xce\x99\xdd\xc2\xc2c\xcb\'\x9d"t\x01\\\x16\xefe\xda\x1a\x9dM}\xdb\x01\x80\
+\x87c\xe4\xe4\xa5(7Xq\xdf)("\xbbPv\x8f\xd2v\x15\xf7(\x1a`\x85\xc3\x87j@\x7f\
+\x8d\xaaA+H\xdf\xdb\x8716\x12\xff\x8eb\x9eW(\x18\xd8w:,^\x1a\xd0\n\xa2w\xfe\
+\x96r\x8a\xe0C\x18\xfd4\xd0\xbd\xce\x80\xa2\xd0\xb8\x82[l\xc6C94\x1a\xad\x89\
+\xc2\xfe\x83\xf6\x02\xe8\x81\xfb\x8d\xea|\x88}\x8cvO\x18\xbb\xfb)+\xee\x7f%,\
+\xd5\xff?\xff\xac\xff?5\xeb\xd5.\x1dr7\xb2\xdfQ\x93\t\n\x91\xf7\xd8#\x9d?\
+\x17\x17\xa9>\xae%\xc8\xe52\xed\x16S\xfd\xa3;\x07\xe0@\x1b\xf7+\x92\xbc\x08\
+\x93V\xc3\xf2{\xab\xea\x03|\xe8\x11.\x9e\x1b\xf8\x98\xf1\xa08\xfc\x1a{\xae\
+\x8diT\x88\x01\xdd4h\r\x9d\x05C|\xffw\x93\xdd\xc9\xc4v\x07\xef\xc6\x15\x951\
+\x18\x95\xa48\xb8\x0b\xac\x07o\xe0WA\xf6\xf5\xb9\xd4\xca\xf9;\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xf8Z{\xc1~n@X\
+\x83\x8c\xc4\x82\xd67\xe4\xf3\x8e\x98\xde\xa9\xe8\x9d\x83S\'h\x94\xb6\xfcC\
+\xe7\x8a\xe2\xbfK\x0e\x87F\x83j\xd5\x90\xab\xe9\xff\xb7\x8b\xff\xa5B\xf0\x7f\
+\x7f\x0c\xf0\x18hhJ,\xe3\xacr\x9c\x05\x02^\xd2\xe2\nb\xd5"F\xdf\xfe\x17]\xf7\
+x\x8e' )
+
+def getBitmap():
+ return BitmapFromImage(getImage())
+
+def getImage():
+ stream = cStringIO.StringIO(getData())
+ return ImageFromStream(stream)
+
+def getIcon():
+ icon = EmptyIcon()
+ icon.CopyFromBitmap(getBitmap())
+ return icon
+
diff --git a/jet_tools/JetCreator/midifile.py b/jet_tools/JetCreator/midifile.py
new file mode 100755
index 0000000..63449c0
--- /dev/null
+++ b/jet_tools/JetCreator/midifile.py
@@ -0,0 +1,1579 @@
+"""
+ File:
+ midifile.py
+
+ Contents and purpose:
+ Utilities used throughout JetCreator
+
+ Copyright (c) 2008 Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+"""
+
+import logging
+import struct
+import copy
+import array
+
+# JET events
+JET_EVENT_MARKER = 102
+JET_MARKER_LOOP_END = 0
+JET_EVENT_TRIGGER_CLIP = 103
+
+# header definitions
+SMF_HEADER_FMT = '>4slHHH'
+SMF_RIFF_TAG = 'MThd'
+
+SMF_TRACK_HEADER_FMT = '>4sl'
+SMF_TRACK_RIFF_TAG = 'MTrk'
+
+# defaults
+DEFAULT_PPQN = 120
+DEFAULT_BEATS_PER_MEASURE = 4
+DEFAULT_TIME_FORMAT = '%03d:%02d:%03d'
+
+# force note-offs to end of list
+MAX_SEQ_NUM = 0x7fffffff
+
+# MIDI messages
+NOTE_OFF = 0x80
+NOTE_ON = 0x90
+POLY_KEY_PRESSURE = 0xa0
+CONTROL_CHANGE = 0xb0
+PROGRAM_CHANGE = 0xc0
+CHANNEL_PRESSURE = 0xd0
+PITCH_BEND = 0xe0
+
+# System common messages
+SYSEX = 0xf0
+MIDI_TIME_CODE = 0xf1
+SONG_POSITION_POINTER = 0xf2
+SONG_SELECT = 0xf3
+RESERVED_F4 = 0xf4
+RESERVED_F5 = 0xf5
+TUNE_REQUEST = 0xf6
+END_SYSEX = 0xf7
+
+# System real-time messages
+TIMING_CLOCK = 0xf8
+RESERVED_F9 = 0xf9
+START = 0xfa
+CONTINUE = 0xfb
+STOP = 0xfc
+RESERVED_FD = 0xfd
+ACTIVE_SENSING = 0xfe
+SYSTEM_RESET = 0xff
+
+ONE_BYTE_MESSAGES = (
+ TUNE_REQUEST,
+ TIMING_CLOCK,
+ RESERVED_F9,
+ START,
+ CONTINUE,
+ STOP,
+ RESERVED_FD,
+ ACTIVE_SENSING,
+ SYSTEM_RESET)
+
+THREE_BYTE_MESSAGES = (
+ NOTE_OFF,
+ NOTE_ON,
+ POLY_KEY_PRESSURE,
+ CONTROL_CHANGE,
+ PITCH_BEND)
+
+MIDI_MESSAGES = (
+ NOTE_OFF,
+ NOTE_ON,
+ POLY_KEY_PRESSURE,
+ CONTROL_CHANGE,
+ CHANNEL_PRESSURE,
+ PITCH_BEND,
+ SYSEX)
+
+# Meta-events
+META_EVENT = 0xff
+META_EVENT_SEQUENCE_NUMBER = 0x00
+META_EVENT_TEXT_EVENT = 0x01
+META_EVENT_COPYRIGHT_NOTICE = 0x02
+META_EVENT_SEQUENCE_TRACK_NAME = 0x03
+META_EVENT_INSTRUMENT_NAME = 0x04
+META_EVENT_LYRIC = 0x05
+META_EVENT_MARKER = 0x06
+META_EVENT_CUE_POINT = 0x07
+META_EVENT_MIDI_CHANNEL_PREFIX = 0x20
+META_EVENT_END_OF_TRACK = 0x2f
+META_EVENT_SET_TEMPO = 0x51
+META_EVENT_SMPTE_OFFSET = 0x54
+META_EVENT_TIME_SIGNATURE = 0x58
+META_EVENT_KEY_SIGNATURE = 0x59
+META_EVENT_SEQUENCER_SPECIFIC = 0x7f
+
+# recurring error messages
+MSG_NOT_SMF_FILE = 'Not an SMF file - aborting parse!'
+MSG_INVALID_TRACK_HEADER = 'Track header is invalid'
+MSG_TYPE_MISMATCH = 'msg_type does not match event type'
+
+LARGE_TICK_WARNING = 1000
+
+# default control values
+CTRL_BANK_SELECT_MSB = 0
+CTRL_MOD_WHEEL = 1
+CTRL_RPN_DATA_MSB = 6
+CTRL_VOLUME = 7
+CTRL_PAN = 10
+CTRL_EXPRESSION = 11
+CTRL_BANK_SELECT_LSB = 32
+CTRL_RPN_DATA_LSB = 38
+CTRL_SUSTAIN = 64
+CTRL_RPN_LSB = 100
+CTRL_RPN_MSB = 101
+CTRL_RESET_CONTROLLERS = 121
+
+RPN_PITCH_BEND_SENSITIVITY = 0
+RPN_FINE_TUNING = 1
+RPN_COARSE_TUNING = 2
+
+MONITOR_CONTROLLERS = (
+ CTRL_BANK_SELECT_MSB,
+ CTRL_MOD_WHEEL,
+ CTRL_RPN_DATA_MSB,
+ CTRL_VOLUME,
+ CTRL_PAN,
+ CTRL_EXPRESSION,
+ CTRL_BANK_SELECT_LSB,
+ CTRL_RPN_DATA_LSB,
+ CTRL_SUSTAIN,
+ CTRL_RPN_LSB,
+ CTRL_RPN_MSB)
+
+MONITOR_RPNS = (
+ RPN_PITCH_BEND_SENSITIVITY,
+ RPN_FINE_TUNING,
+ RPN_COARSE_TUNING)
+
+RPN_PITCH_BEND_SENSITIVITY = 0
+RPN_FINE_TUNING = 1
+RPN_COARSE_TUNING = 2
+
+DEFAULT_CONTROLLER_VALUES = {
+ CTRL_BANK_SELECT_MSB : 121,
+ CTRL_MOD_WHEEL : 0,
+ CTRL_RPN_DATA_MSB : 0,
+ CTRL_VOLUME : 100,
+ CTRL_PAN : 64,
+ CTRL_EXPRESSION : 127,
+ CTRL_RPN_DATA_LSB : 0,
+ CTRL_BANK_SELECT_LSB : 0,
+ CTRL_SUSTAIN : 0,
+ CTRL_RPN_LSB : 0x7f,
+ CTRL_RPN_MSB : 0x7f}
+
+DEFAULT_RPN_VALUES = {
+ RPN_PITCH_BEND_SENSITIVITY : 0x100,
+ RPN_FINE_TUNING : 0,
+ RPN_COARSE_TUNING : 1}
+
+# initialize logger
+midi_file_logger = logging.getLogger('MIDI_file')
+midi_file_logger.setLevel(logging.NOTSET)
+
+
+class trackGrid(object):
+ def __init__ (self, track, channel, name, empty):
+ self.track = track
+ self.channel = channel
+ self.name = name
+ self.empty = empty
+ def __str__ (self):
+ return "['%s', '%s', '%s']" % (self.track, self.channel, self.name)
+
+
+#---------------------------------------------------------------
+# MIDIFileException
+#---------------------------------------------------------------
+class MIDIFileException (Exception):
+ def __init__ (self, stream, msg):
+ stream.error_loc = stream.tell()
+ self.stream = stream
+ self.msg = msg
+ def __str__ (self):
+ return '[%d]: %s' % (self.stream.error_loc, self.msg)
+
+#---------------------------------------------------------------
+# TimeBase
+#---------------------------------------------------------------
+class TimeBase (object):
+ def __init__ (self, ppqn=DEFAULT_PPQN, beats_per_measure=DEFAULT_BEATS_PER_MEASURE):
+ self.ppqn = ppqn
+ self.beats_per_measure = beats_per_measure
+
+ def ConvertToTicks (self, measures, beats, ticks):
+ total_beats = beats + (measures * self.beats_per_measure)
+ total_ticks = ticks + (total_beats * self.ppqn)
+ return total_ticks
+
+ def ConvertTicksToMBT (self, ticks):
+ beats = ticks / self.ppqn
+ ticks -= beats * self.ppqn
+ measures = beats / self.beats_per_measure
+ beats -= measures * self.beats_per_measure
+ return (measures, beats, ticks)
+
+ def ConvertTicksToStr (self, ticks, format=DEFAULT_TIME_FORMAT):
+ measures, beats, ticks = self.ConvertTicksToMBT(ticks)
+ return format % (measures, beats, ticks)
+
+ def ConvertStrTimeToTuple(self, s):
+ try:
+ measures, beats, ticks = s.split(':',3)
+ return (int(measures), int(beats), int(ticks))
+ except:
+ return (0,0,0)
+
+ def ConvertStrTimeToTicks(self, s):
+ measures, beats, ticks = self.ConvertStrTimeToTuple(s)
+ return self.ConvertToTicks(measures, beats, ticks)
+
+ def MbtDifference(self, mbt1, mbt2):
+ t1 = self.ConvertToTicks(mbt1[0], mbt1[1], mbt1[2])
+ t2 = self.ConvertToTicks(mbt2[0], mbt2[1], mbt2[2])
+ return abs(t1-t2)
+
+
+#---------------------------------------------------------------
+# Helper functions
+#---------------------------------------------------------------
+def ReadByte (stream):
+ try:
+ return ord(stream.read(1))
+ except TypeError:
+ stream.error_loc = stream.tell()
+ raise MIDIFileException(stream, 'Unexpected EOF')
+
+def ReadBytes (stream, length):
+ bytes = []
+ for i in range(length):
+ bytes.append(ReadByte(stream))
+ return bytes
+
+def ReadVarLenQty (stream):
+ value = 0
+ while 1:
+ byte = ReadByte(stream)
+ value = (value << 7) + (byte & 0x7f)
+ if byte & 0x80 == 0:
+ return value
+
+def WriteByte (stream, value):
+ stream.write(chr(value))
+
+def WriteBytes (stream, bytes):
+ for byte in bytes:
+ WriteByte(stream, byte)
+
+def WriteVarLenQty (stream, value):
+ bytes = [value & 0x7f]
+ value = value >> 7
+ while value > 0:
+ bytes.append((value & 0x7f) | 0x80)
+ value = value >> 7
+ bytes.reverse()
+ WriteBytes(stream, bytes)
+
+#---------------------------------------------------------------
+# EventFilter
+#---------------------------------------------------------------
+class EventFilter (object):
+ pass
+
+class EventTypeFilter (object):
+ def __init__ (self, events, exclude=True):
+ self.events = events
+ self.exclude = exclude
+ def Check (self, event):
+ if event.msg_type in self.events:
+ return not self.exclude
+ return self.exclude
+
+class NoteFilter (EventFilter):
+ def __init__ (self, notes, exclude=True):
+ self.notes = notes
+ self.exclude = exclude
+ def Check (self, event):
+ if event.msg_type in (NOTE_ON, NOTE_OFF):
+ if event.note in self.notes:
+ return not self.exclude
+ return self.exclude
+
+class ChannelFilter (EventFilter):
+ def __init__ (self, channel, exclude=True):
+ self.channel = channel
+ self.exclude = exclude
+ def Check (self, event):
+ if event.msg_type in (NOTE_ON, NOTE_OFF, POLY_KEY_PRESSURE, CONTROL_CHANGE, CHANNEL_PRESSURE, PITCH_BEND):
+ if event.channel in self.channel:
+ return not self.exclude
+ return self.exclude
+
+#---------------------------------------------------------------
+# MIDIEvent
+#---------------------------------------------------------------
+class MIDIEvent (object):
+ """Factory for creating MIDI events from a stream."""
+ @staticmethod
+ def ReadFromStream (stream, seq, ticks, msg_type):
+ if msg_type == SYSEX:
+ return SysExEvent.ReadFromStream(stream, seq, ticks, msg_type)
+ elif msg_type == END_SYSEX:
+ return SysExContEvent.ReadFromStream(stream, seq, ticks, msg_type)
+ elif msg_type == META_EVENT:
+ return MetaEvent.ReadFromStream(stream, seq, ticks, msg_type)
+ else:
+ high_nibble = msg_type & 0xf0
+ if high_nibble == NOTE_OFF:
+ return NoteOffEvent.ReadFromStream(stream, seq, ticks, msg_type)
+ elif high_nibble == NOTE_ON:
+ return NoteOnEvent.ReadFromStream(stream, seq, ticks, msg_type)
+ elif high_nibble == POLY_KEY_PRESSURE:
+ return PolyKeyPressureEvent.ReadFromStream(stream, seq, ticks, msg_type)
+ elif high_nibble == CONTROL_CHANGE:
+ return ControlChangeEvent.ReadFromStream(stream, seq, ticks, msg_type)
+ elif high_nibble == PROGRAM_CHANGE:
+ return ProgramChangeEvent.ReadFromStream(stream, seq, ticks, msg_type)
+ elif high_nibble == CHANNEL_PRESSURE:
+ return ChannelPressureEvent.ReadFromStream(stream, seq, ticks, msg_type)
+ elif high_nibble == PITCH_BEND:
+ return PitchBendEvent.ReadFromStream(stream, seq, ticks, msg_type)
+ else:
+ stream.Warning('Ignoring unexpected message type 0x%02x' % msg_type)
+ def WriteTicks (self, stream, track):
+ WriteVarLenQty(stream, self.ticks - track.ticks)
+ track.ticks = self.ticks
+ def WriteRunningStatus (self, stream, track, filters, msg, data1, data2=None):
+ if not self.CheckFilters(filters):
+ return
+ self.WriteTicks(stream, track)
+ status = msg + self.channel
+ if track.running_status != status:
+ WriteByte(stream, status)
+ track.running_status = status
+ WriteByte(stream, data1)
+ if data2 is not None:
+ WriteByte(stream, data2)
+ def CheckFilters (self, filters):
+ if filters is None or not len(filters):
+ return True
+
+ # never filter meta-events
+ if (self.msg_type == META_EVENT) and (self.meta_type == META_EVENT_END_OF_TRACK):
+ return True
+
+ # check all filters
+ for f in filters:
+ if not f.Check(self):
+ return False
+ return True
+
+ def TimeEventStr (self, timebase):
+ return '[%s]: %s' % (timebase.ConvertTicksToStr(self.ticks), self.__str__())
+
+#---------------------------------------------------------------
+# NoteOffEvent
+#---------------------------------------------------------------
+class NoteOffEvent (MIDIEvent):
+ def __init__ (self, ticks, seq, channel, note, velocity):
+ self.name = 'NoteOff'
+ self.msg_type = NOTE_OFF
+ self.seq = seq
+ self.ticks = ticks
+ self.channel = channel
+ self.note = note
+ self.velocity = velocity
+ @staticmethod
+ def ReadFromStream (stream, seq, ticks, msg_type):
+ ticks = ticks
+ channel = msg_type & 0x0f
+ note = ReadByte(stream)
+ velocity = ReadByte(stream)
+ if msg_type & 0xf0 != NOTE_OFF:
+ stream.seek(-2,1)
+ raise MIDIFileException(stream, MSG_TYPE_MISMATCH)
+ return NoteOffEvent(ticks, seq, channel, note, velocity)
+ def WriteToStream (self, stream, track, filters=None):
+ # special case for note-off using zero velocity
+ if self.velocity > 0:
+ self.WriteRunningStatus(stream, track, filters, NOTE_ON, self.note, self.velocity)
+ if track.running_status == (NOTE_OFF + self.channel):
+ self.WriteRunningStatus(stream, track, filters, NOTE_ON, self.note, self.velocity)
+ else:
+ self.WriteRunningStatus(stream, track, filters, NOTE_ON, self.note, 0)
+ def __str__ (self):
+ return '%s: ch=%d n=%d v=%d' % (self.name, self.channel, self.note, self.velocity)
+
+#---------------------------------------------------------------
+# NoteOnEvent
+#---------------------------------------------------------------
+class NoteOnEvent (MIDIEvent):
+ def __init__ (self, ticks, seq, channel, note, velocity, note_length, note_off_velocity):
+ self.name = 'NoteOn'
+ self.msg_type = NOTE_ON
+ self.ticks = ticks
+ self.seq = seq
+ self.channel = channel
+ self.note = note
+ self.velocity = velocity
+ self.note_length = note_length
+ self.note_off_velocity = note_off_velocity
+ @staticmethod
+ def ReadFromStream (stream, seq, ticks, msg_type):
+ channel = msg_type & 0x0f
+ note = ReadByte(stream)
+ velocity = ReadByte(stream)
+ if msg_type & 0xf0 != NOTE_ON:
+ stream.seek(-2,1)
+ raise MIDIFileException(stream, MSG_TYPE_MISMATCH)
+ if velocity == 0:
+ return NoteOffEvent(ticks, seq, channel, note, velocity)
+ return NoteOnEvent(ticks, seq, channel, note, velocity, None, None)
+ def WriteToStream (self, stream, track, filters=None):
+ self.WriteRunningStatus(stream, track, filters, NOTE_ON, self.note, self.velocity)
+ def __str__ (self):
+ if self.note_length is not None:
+ return '%s: ch=%d n=%d v=%d l=%d' % (self.name, self.channel, self.note, self.velocity, self.note_length)
+ else:
+ return '%s: ch=%d n=%d v=%d' % (self.name, self.channel, self.note, self.velocity)
+
+#---------------------------------------------------------------
+# PolyKeyPressureEvent
+#---------------------------------------------------------------
+class PolyKeyPressureEvent (MIDIEvent):
+ def __init__ (self, ticks, seq, channel, note, value):
+ self.name = 'PolyKeyPressure'
+ self.msg_type = POLY_KEY_PRESSURE
+ self.ticks = ticks
+ self.seq = seq
+ self.channel = channel
+ self.note = note
+ self.value = value
+ @staticmethod
+ def ReadFromStream (stream, seq, ticks, msg_type):
+ channel = msg_type & 0x0f
+ note = ReadByte(stream)
+ value = ReadByte(stream)
+ if msg_type & 0xf0 != POLY_KEY_PRESSURE:
+ stream.seek(-2,1)
+ raise MIDIFileException(stream, MSG_TYPE_MISMATCH)
+ return PolyKeyPressureEvent(ticks, seq, channel, note, value)
+ def WriteToStream (self, stream, track, filters=None):
+ self.WriteRunningStatus(stream, track, filters, POLY_KEY_PRESSURE, self.note, self.value)
+ def __str__ (self):
+ return '%s: ch=%d n=%d v=%d' % (self.name, self.channel, self.note, self.value)
+
+#---------------------------------------------------------------
+# ControlChangeEvent
+#---------------------------------------------------------------
+class ControlChangeEvent (MIDIEvent):
+ def __init__ (self, ticks, seq, channel, controller, value):
+ self.name = 'ControlChange'
+ self.msg_type = CONTROL_CHANGE
+ self.ticks = ticks
+ self.seq = seq
+ self.channel = channel
+ self.controller = controller
+ self.value = value
+ @staticmethod
+ def ReadFromStream (stream, seq, ticks, msg_type):
+ channel = msg_type & 0x0f
+ controller = ReadByte(stream)
+ value = ReadByte(stream)
+ if msg_type & 0xf0 != CONTROL_CHANGE:
+ stream.seek(-2,1)
+ raise MIDIFileException(stream, MSG_TYPE_MISMATCH)
+ if controller >= 120:
+ return ChannelModeEvent(ticks, seq, channel, controller, value)
+ return ControlChangeEvent(ticks, seq, channel, controller, value)
+ def WriteToStream (self, stream, track, filters=None):
+ self.WriteRunningStatus(stream, track, filters, CONTROL_CHANGE, self.controller, self.value)
+ def __str__ (self):
+ return '%s: ch=%d c=%d v=%d' % (self.name, self.channel, self.controller, self.value)
+
+#---------------------------------------------------------------
+# ChannelModeEvent
+#---------------------------------------------------------------
+class ChannelModeEvent (MIDIEvent):
+ def __init__ (self, ticks, seq, channel, controller, value):
+ self.name = 'ChannelMode'
+ self.msg_type = CONTROL_CHANGE
+ self.ticks = ticks
+ self.seq = seq
+ self.channel = channel
+ self.controller = controller
+ self.value = value
+ @staticmethod
+ def ReadFromStream (stream, seq, ticks, msg_type):
+ channel = msg_type & 0x0f
+ controller = ReadByte(stream)
+ value = ReadByte(stream)
+ if msg_type & 0xf0 != CONTROL_CHANGE:
+ stream.seek(-2,1)
+ raise MIDIFileException(stream, MSG_TYPE_MISMATCH)
+ if controller < 120:
+ return ControlChangeEvent(ticks, seq, channel, controller, value)
+ return ChannelModeEvent(ticks, seq, channel, value)
+ def WriteToStream (self, stream, track, filters=None):
+ self.WriteRunningStatus(stream, track, filters, CONTROL_CHANGE, self.controller, self.value)
+ def __str__ (self):
+ return '%s: ch=%d c=%d v=%d' % (self.name, self.channel, self.controller, self.value)
+
+#---------------------------------------------------------------
+# ProgramChangeEvent
+#---------------------------------------------------------------
+class ProgramChangeEvent (MIDIEvent):
+ def __init__ (self, ticks, seq, channel, program):
+ self.name = 'ProgramChange'
+ self.msg_type = PROGRAM_CHANGE
+ self.ticks = ticks
+ self.seq = seq
+ self.channel = channel
+ self.program = program
+ @staticmethod
+ def ReadFromStream (stream, seq, ticks, msg_type):
+ channel = msg_type & 0x0f
+ program = ReadByte(stream)
+ if msg_type & 0xf0 != PROGRAM_CHANGE:
+ stream.seek(-1,1)
+ raise MIDIFileException(stream, MSG_TYPE_MISMATCH)
+ return ProgramChangeEvent(ticks, seq, channel, program)
+ def WriteToStream (self, stream, track, filters=None):
+ self.WriteRunningStatus(stream, track, filters, PROGRAM_CHANGE, self.program)
+ def __str__ (self):
+ return '%s: ch=%d p=%d' % (self.name, self.channel, self.program)
+
+#---------------------------------------------------------------
+# ChannelPressureEvent
+#---------------------------------------------------------------
+class ChannelPressureEvent (MIDIEvent):
+ def __init__ (self, ticks, seq, channel, value):
+ self.name = 'ChannelPressure'
+ self.msg_type = CHANNEL_PRESSURE
+ self.ticks = ticks
+ self.seq = seq
+ self.channel = channel
+ self.value = value
+ @staticmethod
+ def ReadFromStream (stream, seq, ticks, msg_type):
+ channel = msg_type & 0x0f
+ value = ReadByte(stream)
+ if msg_type & 0xf0 != CHANNEL_PRESSURE:
+ stream.seek(-1,1)
+ raise MIDIFileException(stream, MSG_TYPE_MISMATCH)
+ return ChannelPressureEvent(ticks, seq, channel, value)
+ def WriteToStream (self, stream, track, filters=None):
+ self.WriteRunningStatus(stream, track, filters, CHANNEL_PRESSURE, self.value)
+ def __str__ (self):
+ return '%s: ch=%d v=%d' % (self.name, self.channel, self.value)
+
+#---------------------------------------------------------------
+# PitchBendEvent
+#---------------------------------------------------------------
+class PitchBendEvent (MIDIEvent):
+ def __init__ (self, ticks, seq, channel, value):
+ self.name = 'PitchBend'
+ self.msg_type = PITCH_BEND
+ self.ticks = ticks
+ self.seq = seq
+ self.channel = channel
+ self.value = value
+ @staticmethod
+ def ReadFromStream (stream, seq, ticks, msg_type):
+ channel = msg_type & 0x0f
+ value = (ReadByte(stream) << 7) + ReadByte(stream) - 0x2000
+ if msg_type & 0xf0 != PITCH_BEND:
+ stream.seek(-2,1)
+ raise MIDIFileException(stream, MSG_TYPE_MISMATCH)
+ return PitchBendEvent(ticks, seq, channel, value)
+ def WriteToStream (self, stream, track, filters=None):
+ value = self.value + 0x2000
+ if value < 0:
+ value = 0
+ if value > 0x3fff:
+ value = 0x3fff
+ self.WriteRunningStatus(stream, track, filters, PITCH_BEND, value >> 7, value & 0x7f)
+ def __str__ (self):
+ return '%s: ch=%d v=%d' % (self.name, self.channel, self.value)
+
+#---------------------------------------------------------------
+# SysExEvent
+#---------------------------------------------------------------
+class SysExEvent (MIDIEvent):
+ def __init__ (self, ticks, seq, msg):
+ self.name = 'SysEx'
+ self.msg_type = SYSEX
+ self.ticks = ticks
+ self.seq = seq
+ self.length = len(msg)
+ self.msg = msg
+ @staticmethod
+ def ReadFromStream (stream, seq, ticks, msg_type):
+ pos = stream.tell()
+ length = ReadVarLenQty(stream)
+ msg = ReadBytes(stream, length)
+ if msg_type != SYSEX:
+ stream.seek(pos,0)
+ raise MIDIFileException(stream, MSG_TYPE_MISMATCH)
+ return SysExEvent(ticks, seq, msg)
+ def WriteToStream (self, stream, track, filters=None):
+ if not self.CheckFilters(filters):
+ return
+ self.WriteTicks(stream, track)
+ WriteByte(stream, SYSEX)
+ WriteVarLenQty(stream, self.length)
+ WriteBytes(stream, self.msg)
+ track.running_status = None
+ def __str__ (self):
+ fmt_str = '%s: f0' + ' %02x'*self.length
+ return fmt_str % ((self.name,) + tuple(self.msg))
+
+#---------------------------------------------------------------
+# SysExContEvent
+#---------------------------------------------------------------
+class SysExContEvent (MIDIEvent):
+ def __init__ (self, ticks, seq, msg):
+ self.name = 'SysEx+'
+ self.msg_type = END_SYSEX
+ self.ticks = ticks
+ self.seq = seq
+ self.length = len(msg)
+ self.msg = msg
+ @staticmethod
+ def ReadFromStream (stream, seq, ticks, msg_type):
+ pos = stream.tell()
+ length = ReadVarLenQty(stream)
+ msg = ReadBytes(stream, length)
+ if msg_type != END_SYSEX:
+ stream.seek(pos,0)
+ raise MIDIFileException(stream, MSG_TYPE_MISMATCH)
+ return SysExContEvent(ticks, seq, msg)
+ def WriteToStream (self, stream, track, filters=None):
+ if not self.CheckFilters(filters):
+ return
+ self.WriteTicks(stream, track)
+ WriteByte(stream, END_SYSEX)
+ WriteVarLenQty(stream, self.length)
+ WriteBytes(stream, self.msg)
+ track.running_status = None
+ def __str__ (self):
+ fmt_str = '%s:' + ' %02x'*self.length
+ return fmt_str % ((self.name,) + tuple(self.msg))
+
+#---------------------------------------------------------------
+# MetaEvent
+#---------------------------------------------------------------
+class MetaEvent (MIDIEvent):
+ def __init__ (self, ticks, seq, meta_type, msg):
+ self.name = 'MetaEvent'
+ self.msg_type = META_EVENT
+ self.ticks = ticks
+ self.seq = seq
+ self.meta_type = meta_type
+ self.length = len(msg)
+ self.msg = msg
+ @staticmethod
+ def ReadFromStream (stream, seq, ticks, msg_type):
+ pos = stream.tell()
+ meta_type = ReadByte(stream)
+ length = ReadVarLenQty(stream)
+ msg = ReadBytes(stream, length)
+ if msg_type != META_EVENT:
+ stream.seek(pos,0)
+ raise MIDIFileException(stream, MSG_TYPE_MISMATCH)
+ obj = MetaEvent(ticks, seq, meta_type, msg)
+ return obj
+ def WriteToStream (self, stream, track, filters=None):
+ if not self.CheckFilters(filters):
+ return
+ self.WriteTicks(stream, track)
+ WriteByte(stream, META_EVENT)
+ WriteByte(stream, self.meta_type)
+ WriteVarLenQty(stream, self.length)
+ WriteBytes(stream, self.msg)
+ track.running_status = None
+ def __str__ (self):
+ fmt_str = '%s: %02x' + ' %02x'*self.length
+ return fmt_str % ((self.name, self.meta_type) + tuple(self.msg))
+
+#---------------------------------------------------------------
+# MIDIControllers
+#---------------------------------------------------------------
+class MIDIControllers (object):
+ def __init__ (self):
+ self.controllers = []
+ self.rpns = []
+ for channel in range(16):
+ self.controllers.append({})
+ self.controllers[channel] = copy.deepcopy(DEFAULT_CONTROLLER_VALUES)
+ self.rpns.append({})
+ self.rpns[channel] = copy.deepcopy(DEFAULT_RPN_VALUES)
+ self.pitchbend = [0] * 16
+ self.program = [-1] * 16
+ self.pressure = [0] * 16
+
+ def __str__ (self):
+ output = []
+ for channel in range(16):
+ output.append('channel=%d' % channel)
+ output.append(' program=%d' % self.program[channel])
+ output.append(' pressure=%d' % self.pressure[channel])
+
+ output.append(' controllers')
+ for controller in self.controllers[channel].keys():
+ output.append(' %03d: %03d' % (controller, self.controllers[channel][controller]))
+
+ output.append(' rpns')
+ for rpn in self.rpns[channel].keys():
+ output.append(' %05d: %05d>' % (controller, self.rpns[channel][rpn]))
+ return '\n'.join(output)
+
+
+ def Event (self, event):
+ """Process an event and save any changes in controller values"""
+ # process control changes
+ if event.msg_type == CONTROL_CHANGE:
+ self.ControlChange(event)
+ elif event.msg_type == CHANNEL_PRESSURE:
+ self.PressureChange(event)
+ elif event.msg_type == PROGRAM_CHANGE:
+ self.ProgramChange(event)
+ elif event.msg_type == PITCH_BEND:
+ self.PitchBendChange(event)
+
+ def PitchBendChange (self, event):
+ """Monitor pitch bend change."""
+ self.pitchbend[event.channel] = event.value
+
+ def ProgramChange (self, event):
+ """Monitor program change."""
+ self.program[event.channel] = event.program
+
+ def ControlChange (self, event):
+ """Monitor control change."""
+ controller = event.controller
+ if controller in MONITOR_CONTROLLERS:
+ channel = event.channel
+ self.controllers[channel][controller] = event.value
+ if (controller == CTRL_RPN_DATA_MSB) or (controller == CTRL_RPN_DATA_LSB):
+ rpn = (self.controllers[channel][CTRL_RPN_MSB] << 7) + self.controllers[channel][CTRL_RPN_LSB]
+ if rpn in MONITOR_RPNS:
+ value = (self.controllers[channel][CTRL_RPN_DATA_MSB] << 7) + self.controllers[channel][CTRL_RPN_DATA_LSB]
+ self.rpns[channel][rpn] = value
+
+ # reset controllers
+ elif event.controller == CTRL_RESET_CONTROLLERS:
+ self.ResetControllers[event.channel]
+
+ def PressureChange (self, event):
+ """Monitor pressure change."""
+ self.pressure[event.channel] = event.value
+
+ def ResetControllers (self, channel):
+ """Reset controllers to default."""
+ self.controllers[channel] = DEFAULT_CONTROLLER_VALUES
+ self.rpns[channel] = DEFAULT_RPN_VALUES
+ self.pressure[channel] = 0
+
+ def GenerateEventList (self, ticks, ref_values=None):
+ """Generate an event list based on controller differences."""
+ events = EventList()
+
+ # if no reference values, based on default values
+ if ref_values is None:
+ ref_values = MIDIControllers()
+
+ # iterate through 16 MIDI channels
+ for channel in range(16):
+
+ # generate RPN changes
+ for rpn in self.rpns[channel].keys():
+ value = self.rpns[channel][rpn]
+ if value != ref_values.rpns[channel][rpn]:
+ events.append(ControlChangeEvent(ticks, -1, channel, CTRL_RPN_MSB, rpn >> 7))
+ events.append(ControlChangeEvent(ticks, -1, channel, CTRL_RPN_LSB, rpn & 0x7f))
+ events.append(ControlChangeEvent(ticks, -1, channel, CTRL_RPN_DATA_MSB, value >> 7))
+ events.append(ControlChangeEvent(ticks, -1, channel, CTRL_RPN_DATA_LSB, value & 0x7f))
+
+ # generate controller changes
+ for controller in self.controllers[channel].keys():
+ if self.controllers[channel][controller] != ref_values.controllers[channel][controller]:
+ events.append(ControlChangeEvent(ticks, -1, channel, controller, self.controllers[channel][controller]))
+
+ # generate pressure changes
+ if self.pressure[channel] != ref_values.pressure[channel]:
+ events.append(ChannelPressureEvent(ticks, -1, channel, self.pressure[channel]))
+
+ # generate program changes
+ if self.program[channel] != ref_values.program[channel]:
+ if self.program[channel] in range(128):
+ events.append(ProgramChangeEvent(ticks, -1, channel, self.program[channel]))
+
+ # generate pitch bend changes
+ if self.pitchbend[channel] != ref_values.pitchbend[channel]:
+ if self.pitchbend[channel] in range(-8192,8191):
+ events.append(PitchBendEvent(ticks, -1, channel, self.pitchbend[channel]))
+
+ return events
+
+#---------------------------------------------------------------
+# EventList
+#---------------------------------------------------------------
+class EventList (list):
+ def __init__ (self):
+ list.__init__(self)
+
+ def FixNoteLengths (self):
+ midi_file_logger.debug('Fix note lengths')
+
+ # search for note-on's in event list
+ for index in range(len(self)):
+ event = self[index]
+ if event.msg_type == NOTE_ON:
+ note_off_ticks = event.ticks + event.note_length
+
+ # check for note-on occuring before end of current note
+ for i in range(index + 1, len(self)):
+ event_to_check = self[i]
+ if event_to_check.ticks >= note_off_ticks:
+ break
+
+ # adjust note length
+ if (event_to_check.msg_type == NOTE_ON) and (event_to_check.note == event.note):
+ midi_file_logger.debug('Adjusting note length @ %d' % event.ticks)
+ event.note_length = event_to_check.ticks - event.ticks
+ break
+
+ def ChaseControllers (self, end_seq, start_seq = 0, values = None):
+ midi_file_logger.debug('ChaseControllers from %d to %d' % (start_seq, end_seq))
+
+ # initialize controller values
+ if values is None:
+ values = MIDIControllers()
+
+ # chase controllers in track
+ for i in range(start_seq, min(end_seq, len(self))):
+ values.Event(self[i])
+
+ # return new values
+ return values
+
+ def SelectEvents (self, start, end):
+ midi_file_logger.debug('SelectEvents: %d to %d' % (start, end))
+ selected = EventList()
+ for event in self:
+ if event.ticks >= start:
+ if event.ticks >= end:
+ break
+ midi_file_logger.debug('SelectEvent: %s' % event.__str__())
+ selected.append(event)
+ return selected
+
+ def MergeEvents (self, events):
+ # copy events and sort them by ticks/sequence#
+ self.extend(events)
+ self.SortEvents()
+
+ def InsertEvents (self, events, seq):
+ self[seq:seq] = events
+ self.RenumberSeq()
+
+ def DeleteEvents (self, start_index, end_index, move_meta_events=None):
+ # default parameters
+ if start_index is None:
+ start_index = 0
+ if end_index is None:
+ end_index = len(self)
+
+ #print("\n")
+ #for evt in self[start_index:end_index]:
+ # print("%d %s" % (evt.ticks, evt))
+
+ # delete events
+ delete_count = 0
+ move_count = 0
+ for event in self[start_index:end_index]:
+ #Bth; Added this so we always get clip end events; clips that ended on last measure wouldn't end on repeat
+ if (event.msg_type == CONTROL_CHANGE) and \
+ (event.controller == JET_EVENT_TRIGGER_CLIP) and \
+ ((event.value & 0x40) != 0x40):
+ pass
+ else:
+ if (move_meta_events is None) or (event.msg_type != META_EVENT):
+ self.remove(event)
+ delete_count += 1
+
+ # move meta-events
+ else:
+ event.ticks = move_meta_events
+ move_count += 1
+
+ midi_file_logger.debug('DeleteEvents: deleted %d events in range(%s:%s)' % (delete_count, start_index, end_index))
+ midi_file_logger.debug('DeleteEvents: moved %d events in range(%s:%s)' % (move_count, start_index, end_index))
+
+
+ def SeekEvent (self, pos):
+ for i in range(len(self)):
+ if self[i].ticks >= pos:
+ return i
+ return None
+
+ def RenumberSeq (self):
+ seq = 0
+ for event in self:
+ event.seq = seq
+ seq += 1
+
+ def SortEvents (self):
+ self.sort(self.EventSorter)
+ self.RenumberSeq()
+
+ @staticmethod
+ def EventSorter (x, y):
+ if x.ticks == y.ticks:
+ return cmp(x.seq, y.seq)
+ else:
+ return cmp(x.ticks, y.ticks)
+
+ def DumpEvents (self, output, timebase):
+ if output is not None:
+ for event in self:
+ output.write('%s\n' % event.TimeEventStr(timebase))
+ else:
+ for event in self:
+ midi_file_logger.debug(event.TimeEventStr(timebase))
+
+#---------------------------------------------------------------
+# MIDITrack
+#---------------------------------------------------------------
+class MIDITrack (object):
+ """The MIDITrack class implements methods for reading, parsing,
+ modifying, and writing tracks in Standard MIDI Files (SMF).
+
+ """
+ def __init__ (self):
+ self.length = 0
+ self.events = EventList()
+ self.end_of_track = None
+ self.channel = None
+ self.name = None
+
+ def ReadFromStream (self, stream, offset, file_size):
+ self.stream = stream
+ ticks = 0
+ seq = 0
+ running_status = None
+ tick_warning_level = stream.timebase.ppqn * LARGE_TICK_WARNING
+
+ # read the track header - verify it's an SMF track
+ stream.seek(offset)
+ bytes = stream.read(struct.calcsize(SMF_TRACK_HEADER_FMT))
+ riff_tag, track_len = struct.unpack(SMF_TRACK_HEADER_FMT, bytes)
+ midi_file_logger.debug('SMF track header\n Tag: %s\n TrackLen: %d' % (riff_tag, track_len))
+ if (riff_tag != SMF_TRACK_RIFF_TAG):
+ raise MIDIFileException(stream, MSG_INVALID_TRACK_HEADER)
+ self.start = stream.tell()
+
+ # check for valid track length
+ if (self.start + track_len) > file_size:
+ stream.Warning('Ignoring illegal track length - %d exceeds length of file' % track_len)
+ track_len = None
+
+ # read the entire track
+ note_on_list = []
+ while 1:
+
+ # save current position
+ pos = stream.tell()
+
+ # check for end of track
+ if track_len is not None:
+ if (pos - self.start) >= track_len:
+ break
+
+ # are we past end of track?
+ if self.end_of_track:
+ stream.Warning('Ignoring data encountered beyond end-of-track meta-event')
+ break;
+
+ # read delta timestamp
+ delta = ReadVarLenQty(stream)
+ if ticks > tick_warning_level:
+ stream.Warning('Tick value is excessive - possibly corrupt data?')
+ ticks += delta
+
+ # get the event type and process it
+ msg_type = ReadByte(stream)
+
+ # if data byte, check for running status
+ if msg_type & 0x80 == 0:
+
+ # use running status
+ msg_type = running_status
+
+ # back up so event can process data
+ stream.seek(-1,1)
+
+ # if no running status, we have a problem
+ if not running_status:
+ stream.Warning('Ignoring data byte received with no running status')
+
+ # create event type from stream
+ event = MIDIEvent.ReadFromStream(stream, seq, ticks, msg_type)
+
+ if self.channel == None:
+ try:
+ self.channel = event.channel
+ except AttributeError:
+ pass
+
+ # track note-ons
+ if event.msg_type == NOTE_ON:
+
+ """
+ Experimental code to clean up overlapping notes
+ Clean up now occurs during write process
+
+ for note_on in note_on_list:
+ if (event.channel == note_on.channel) and (event.note == note_on.note):
+ stream.Warning('Duplicate note-on\'s encountered without intervening note-off')
+ stream.Warning(' [%s]: %s' % (stream.timebase.ConvertTicksToStr(event.ticks), event.__str__()))
+ note_on.note_length = event.ticks - note_on.ticks - 1
+ if note_on.note_length <= 0:
+ stream.Warning('Eliminating duplicate note-on')
+ event.ticks = note_on.ticks
+ self.events.remove(note_on)
+ """
+
+ note_on_list.append(event)
+
+ # process note-offs
+ if event.msg_type == NOTE_OFF:
+ for note_on in note_on_list[:]:
+ if (event.channel == note_on.channel) and (event.note == note_on.note):
+ note_on.note_length = event.ticks - note_on.ticks
+ note_on.note_off_velocity = event.velocity
+ note_on_list.remove(note_on)
+ break
+ #else:
+ # stream.Warning('Note-off encountered without corresponding note-on')
+ # stream.Warning(' [%s]: %s' % (stream.timebase.ConvertTicksToStr(event.ticks), event.__str__()))
+
+ # check for end of track
+ elif event.msg_type == META_EVENT and event.meta_type == META_EVENT_END_OF_TRACK:
+ self.end_of_track = event.ticks
+
+ # BTH; get track name
+ elif event.msg_type == META_EVENT and event.meta_type == META_EVENT_SEQUENCE_TRACK_NAME:
+ self.name = array.array('B', event.msg).tostring()
+
+ # append event to event list
+ else:
+ self.events.append(event)
+ seq += 1
+
+ # save position for port-mortem
+ stream.last_good_event = pos
+
+ # update running statusc_str(
+ if msg_type < 0xf0:
+ running_status = msg_type
+ elif (msg_type < 0xf8) or (msg_type == 0xff):
+ running_status = None
+
+ # check for stuck notes
+ #if len(note_on_list):
+ # stream.Warning('Note-ons encountered without corresponding note-offs')
+
+ # check for missing end-of-track meta-event
+ if self.end_of_track is None:
+ self.last_tick = self.events[-1].ticks
+ stream.Warning('End of track encountered with no end-of-track meta-event')
+
+ # if track length was bad, correct it
+ if track_len is None:
+ track_len = stream.tell() - offset - 8
+
+ return track_len
+
+ def Write (self, stream, filters=None):
+ # save current file position so we can write header
+ header_loc = stream.tell()
+ stream.seek(header_loc + struct.calcsize(SMF_TRACK_HEADER_FMT))
+
+ # save a copy of the event list so we can restore it
+ save_events = copy.copy(self.events)
+
+ # create note-off events
+ index = 0
+ while 1:
+ if index >= len(self.events):
+ break
+
+ # if note-on event, create a note-off event
+ event = self.events[index]
+ index += 1
+ if event.msg_type == NOTE_ON:
+ note_off = NoteOffEvent(event.ticks + event.note_length, index, event.channel, event.note, event.note_off_velocity)
+
+ # insert note-off in list
+ for i in range(index, len(self.events)):
+ if self.events[i].ticks >= note_off.ticks:
+ self.events.insert(i, note_off)
+ break
+ else:
+ self.events.append(note_off)
+
+ # renumber list
+ self.events.RenumberSeq()
+
+ # write the events
+ self.running_status = None
+ self.ticks = 0
+ for event in self.events:
+
+ # write event
+ event.WriteToStream(stream, self, filters)
+
+ # restore original list (without note-off events)
+ self.events = save_events
+
+ # write the end-of-track meta-event
+ MetaEvent(self.end_of_track, 0, META_EVENT_END_OF_TRACK,[]).WriteToStream(stream, self, None)
+
+ # write track header
+ end_of_track = stream.tell()
+ track_len = end_of_track - header_loc - struct.calcsize(SMF_TRACK_HEADER_FMT)
+ stream.seek(header_loc)
+ bytes = struct.pack(SMF_TRACK_HEADER_FMT, SMF_TRACK_RIFF_TAG, track_len)
+ stream.write(bytes)
+ stream.seek(end_of_track)
+
+ def Trim (self, start, end, slide=True, chase_controllers=True, delete_meta_events=False, quantize=0):
+ controllers = None
+
+ if quantize:
+ # quantize events just before start
+ for event in self.events.SelectEvents(start - quantize, start):
+ midi_file_logger.debug('Trim: Moving event %s to %d' % (event.__str__(), start))
+ event.ticks = start
+
+ # quantize events just before end
+ for event in self.events.SelectEvents(end - quantize, end):
+ midi_file_logger.debug('Trim: Moving event %s to %d' % (event.__str__(), end))
+ event.ticks = end
+
+ # trim start
+ if start:
+
+ # find first event inside trim
+ start_event = self.events.SeekEvent(start)
+ if start_event is not None:
+
+ # chase controllers to cut point
+ if chase_controllers:
+ controllers = self.events.ChaseControllers(self.events[start_event].seq)
+ controller_events = controllers.GenerateEventList(0)
+ midi_file_logger.debug('Trim: insert new controller events at %d:' % start)
+ controller_events.DumpEvents(None, self.stream.timebase)
+ self.events.InsertEvents(controller_events, start_event)
+
+ # delete events
+ midi_file_logger.debug('Trim: deleting events up to event %d' % start_event)
+ if delete_meta_events:
+ self.events.DeleteEvents(None, start_event, None)
+ else:
+ self.events.DeleteEvents(None, start_event, start)
+
+ # delete everything except metadata
+ else:
+ self.events.DeleteEvents(None, None, start)
+
+ # trim end
+ end_event = self.events.SeekEvent(end)
+ if end_event is not None:
+ midi_file_logger.debug('Trim: trimming section starting at event %d' % end_event)
+ self.events.DeleteEvents(end_event, None)
+
+ # trim any notes that extend past the end
+ for event in self.events:
+ if event.msg_type == NOTE_ON:
+ if (event.ticks + event.note_length) > end:
+ midi_file_logger.debug('Trim: trimming note that extends past end %s' % event.TimeEventStr(self.stream.timebase))
+ event.note_length = end - event.ticks
+ if event.note_length <= 0:
+ raise 'Error in note length - note should have been deleted'
+
+ midi_file_logger.debug('Trim: initial end-of-track: %d' % self.end_of_track)
+ self.end_of_track = min(self.end_of_track, end)
+
+ # slide events to start of track to fill hole
+ if slide and start:
+ midi_file_logger.debug('Trim: sliding events: %d' % start)
+ for event in self.events:
+ if event.ticks > start:
+ event.ticks -= start
+ else:
+ event.ticks = 0
+ self.end_of_track = max(0, self.end_of_track - start)
+ midi_file_logger.debug('Trim: new end-of-track: %d' % self.end_of_track)
+
+ self.events.RenumberSeq()
+ self.events.FixNoteLengths()
+
+ def DumpEvents (self, output):
+ self.events.DumpEvents(output, self.stream.timebase)
+ if output is not None:
+ output.write('[%s]: end-of-track\n' % self.stream.timebase.ConvertTicksToStr(self.end_of_track))
+ else:
+ midi_file_logger.debug('[%s]: end-of-track' % self.stream.timebase.ConvertTicksToStr(self.end_of_track))
+
+
+#---------------------------------------------------------------
+# MIDIFile
+#---------------------------------------------------------------
+class MIDIFile (file):
+ """The MIDIFile class implements methods for reading, parsing,
+ modifying, and writing Standard MIDI Files (SMF).
+
+ """
+ def __init__ (self, name, mode):
+ file.__init__(self, name, mode)
+ self.timebase = TimeBase()
+
+ def ReadFromStream (self, start_offset=0, file_size=None):
+ """Parse the MIDI file creating a list of properties, tracks,
+ and events based on the contents of the file.
+
+ """
+
+ # determine file size - without using os.stat
+ if file_size == None:
+ self.start_offset = start_offset
+ self.seek(0,2)
+ file_size = self.tell() - self.start_offset
+ self.seek(start_offset,0)
+ else:
+ file_size = file_size
+
+ # for error recovery
+ self.last_good_event = None
+ self.error_loc = None
+
+ # read the file header - verify it's an SMF file
+ bytes = self.read(struct.calcsize(SMF_HEADER_FMT))
+ riff_tag, self.hdr_len, self.format, self.num_tracks, self.timebase.ppqn = struct.unpack(SMF_HEADER_FMT, bytes)
+ midi_file_logger.debug('SMF header\n Tag: %s\n HeaderLen: %d\n Format: %d\n NumTracks: %d\n PPQN: %d\n' % \
+ (riff_tag, self.hdr_len, self.format, self.num_tracks, self.timebase.ppqn))
+
+ # sanity check on header
+ if (riff_tag != SMF_RIFF_TAG) or (self.format not in range(2)):
+ raise MIDIFileException(self, MSG_NOT_SMF_FILE)
+
+ # check for odd header size
+ if self.hdr_len + 8 != struct.calcsize(SMF_HEADER_FMT):
+ self.Warning('SMF file has unusual header size: %d bytes' % self.hdr_len)
+
+ # read each of the tracks
+ offset = start_offset + self.hdr_len + 8
+ self.tracks = []
+ self.end_of_file = 0
+ for i in range(self.num_tracks):
+ #print("Track: %d" % i)
+
+ # parse the track
+ track = MIDITrack()
+ length = track.ReadFromStream(self, offset, file_size)
+ track.trackNum = i
+
+ self.tracks.append(track)
+
+ # calculate offset to next track
+ offset += length + 8
+
+ # determine time of last event
+ self.end_of_file = max(self.end_of_file, track.end_of_track)
+
+ # if start_offset is zero, the final offset should match the file length
+ if (offset - start_offset) != file_size:
+ self.Warning('SMF file size is incorrect - should be %d, was %d' % (file_size, offset))
+
+ def Save (self, offset=0, filters=None):
+ """Save this file back to disk with modifications."""
+ if (not 'w' in self.mode) and (not '+' in self.mode):
+ raise MIDIFileException(self, 'Cannot write to file in read-only mode')
+ self.Write(self, offset, filters)
+
+ def SaveAs (self, filename, offset=0, filters=None):
+ """Save MIDI data to new file."""
+ output_file = MIDIFile(filename, 'wb')
+ self.Write(output_file, offset, filters)
+ output_file.close()
+
+ def Write (self, output_file, offset=0, filters=None):
+ """This function does the actual work of writing the file."""
+ # write the file header
+ output_file.seek(offset)
+ bytes = struct.pack(SMF_HEADER_FMT, SMF_RIFF_TAG, struct.calcsize(SMF_HEADER_FMT) - 8, self.format, self.num_tracks, self.timebase.ppqn)
+ output_file.write(bytes)
+
+ # write out the tracks
+ for track in self.tracks:
+ track.Write(output_file, filters)
+
+ # flush the data to disk
+ output_file.flush()
+
+ def ConvertToType0 (self):
+ """Convert a file to type 0."""
+ if self.format == 0:
+ midi_file_logger.warning('File is already type 0 - ignoring request to convert')
+ return
+
+ # convert to type 0
+ for track in self.tracks[1:]:
+ self.tracks[0].MergeEvents(track.events)
+ self.tracks = self.tracks[:1]
+ self.num_tracks = 1
+ self.format = 0
+
+ def DeleteEmptyTracks (self):
+ """Delete any tracks that do not contain MIDI messages"""
+ track_num = 0
+ for track in self.tracks[:]:
+ for event in self.tracks.events:
+ if event.msg_type in MIDI_MESSAGES:
+ break;
+ else:
+ midi_file_logger.debug('Deleting track %d' % track_num)
+ self.tracks.remove(track)
+ track_num += 1
+
+ def ConvertToTicks (self, measures, beats, ticks):
+ return self.timebase.ConvertToTicks(measures, beats, ticks)
+
+ def Trim (self, start, end, quantize=0, chase_controllers=True):
+ track_num = 0
+ for track in self.tracks:
+ midi_file_logger.debug('Trimming track %d' % track_num)
+ track.Trim(start, end, quantize=quantize, chase_controllers=chase_controllers)
+ track_num += 1
+
+ def DumpTracks (self, output=None):
+ track_num = 0
+ for track in self.tracks:
+ if output is None:
+ midi_file_logger.debug('*** Track %d ***' % track_num)
+ else:
+ output.write('*** Track %d ***' % track_num)
+ track.DumpEvents(output)
+ track_num += 1
+
+ def Warning (self, msg):
+ midi_file_logger.warning('[%d]: %s' % (self.tell(), msg))
+
+ def Error (self, msg):
+ midi_file_logger.error('[%d]: %s' % (self.tell(), msg))
+
+ def DumpError (self):
+ if self.last_good_event:
+ midi_file_logger.error('Dumping from last good event:')
+ pos = self.last_good_event - 16
+ length = self.error_loc - pos + 16
+ elif self.error_loc:
+ midi_file_logger.error('Dumping from 16 bytes prior to error:')
+ pos = self.error_loc
+ length = 32
+ else:
+ midi_file_logger.error('No dump information available')
+ return
+
+ self.seek(pos, 0)
+ for i in range(length):
+ if i % 16 == 0:
+ if i:
+ midi_file_logger.error(' '.join(debug_out))
+ debug_out = ['%08x:' % (pos + i)]
+ byte = self.read(1)
+ if len(byte) == 0:
+ break;
+ debug_out.append('%02x' % ord(byte))
+ if i % 16 > 0:
+ midi_file_logger.error(' '.join(debug_out))
+
+def GetMidiInfo(midiFile):
+ """Bth; Get MIDI info"""
+
+ class midiData(object):
+ def __init__ (self):
+ self.err = 1
+ self.endMbt = "0:0:0"
+ self.totalTicks = 0
+ self.maxTracks = 0
+ self.maxMeasures = 0
+ self.maxBeats = 0
+ self.maxTicks = 0
+ self.totalTicks = 0
+ self.timebase = None
+ self.ppqn = 0
+ self.beats_per_measure = 0
+ self.trackList = []
+
+ md = midiData()
+
+ try:
+ m = MIDIFile(midiFile, 'rb')
+ m.ReadFromStream()
+
+ for track in m.tracks:
+ if track.channel is not None:
+ empty = False
+ trk = track.channel + 1
+ else:
+ empty = True
+ trk = ''
+ md.trackList.append(trackGrid(track.trackNum, trk, track.name, empty))
+
+ md.endMbt = m.timebase.ConvertTicksToMBT(m.end_of_file)
+ md.endMbtStr = "%d:%d:%d" % (md.endMbt[0], md.endMbt[1], md.endMbt[2])
+ md.maxMeasures = md.endMbt[0]
+ md.maxBeats = 4
+ md.maxTicks = m.timebase.ppqn
+ md.maxTracks = m.num_tracks
+ md.totalTicks = m.end_of_file
+ md.timebase = m.timebase
+ md.ppqn = m.timebase.ppqn
+ md.beats_per_measure = m.timebase.beats_per_measure
+
+ #add above if more added
+ md.err = 0
+
+ m.close()
+ except:
+ raise
+ pass
+
+ return md
+
+
+
+
+#---------------------------------------------------------------
+# main
+#---------------------------------------------------------------
+if __name__ == '__main__':
+ sys = __import__('sys')
+ os = __import__('os')
+
+ # initialize root logger
+ root_logger = logging.getLogger('')
+ root_logger.setLevel(logging.NOTSET)
+
+ # initialize console handler
+ console_handler = logging.StreamHandler()
+ console_handler.setFormatter(logging.Formatter('%(message)s'))
+ console_handler.setLevel(logging.DEBUG)
+ root_logger.addHandler(console_handler)
+
+ files = []
+ dirs = []
+ last_arg = None
+ sysex_filter = False
+ drum_filter = False
+ convert = False
+
+ # process args
+ for arg in sys.argv[1:]:
+
+ # previous argument implies this argument
+ if last_arg is not None:
+ if last_arg == '-DIR':
+ dirs.append(arg)
+ last_arg = None
+
+ # check for switch
+ elif arg[0] == '-':
+ if arg == '-DIR':
+ last_arg = arg
+ elif arg == '-SYSEX':
+ sysex_filter = True
+ elif arg == '-DRUMS':
+ drum_filter = True
+ elif arg == '-CONVERT':
+ convert = True
+ else:
+ midi_file_logger.error('Bad option %s' % arg)
+
+ # must be a filename
+ else:
+ files.append(arg)
+
+ # setup filters
+ filters = []
+ if sysex_filter:
+ filters.append(EventTypeFilter((SYSEX,)))
+ if drum_filter:
+ filters.append(ChannelFilter((9,),False))
+
+
+ # process dirs
+ for d in dirs:
+ for root, dir_list, file_list in os.walk(d):
+ for f in file_list:
+ if f.endswith('.mid'):
+ files.append(os.path.join(root, f))
+
+ # process files
+ bad_files = []
+ for f in files:
+ midi_file_logger.info('Processing file %s' % f)
+ midiFile = MIDIFile(f, 'rb')
+ try:
+ midiFile.ReadFromStream()
+
+ #midiFile.DumpTracks()
+ #print('[%s]: end-of-track\n' % midiFile.timebase.ConvertTicksToStr(midiFile.end_of_file))
+
+ # convert to type 0
+ if convert and (midiFile.format == 1):
+ midiFile.Convert(0)
+ converted = True
+ else:
+ converted = False
+
+ # write processed file
+ if converted or len(filters):
+ midiFile.SaveAs(f[:-4] + '-mod.mid', filters)
+
+ except MIDIFileException, X:
+ bad_files.append(f)
+ midi_file_logger.error('Error in file %s' % f)
+ midi_file_logger.error(X)
+ midiFile.DumpError()
+ midiFile.close()
+
+ # dump problem files
+ if len(bad_files):
+ midi_file_logger.info('The following file(s) had errors:')
+ for f in bad_files:
+ midi_file_logger.info(f)
+ else:
+ midi_file_logger.info('All files read successfully')
+