com.groovemanager.app.mc909se
Class Mc909SampleEditor

java.lang.Object
  extended by org.eclipse.jface.window.Window
      extended by org.eclipse.jface.window.ApplicationWindow
          extended by com.groovemanager.gui.EditorWindow
              extended by com.groovemanager.app.sse.SimpleSampleEditor
                  extended by com.groovemanager.app.mc909se.Mc909SampleEditor
All Implemented Interfaces:
AudioFileSaveListener, FileCloseListener, FileNewListener, FileOpenListener, FileSaveListener, org.eclipse.jface.operation.IRunnableContext, KeyboardKeyListener, WaveDisplayListener

public class Mc909SampleEditor
extends SimpleSampleEditor
implements KeyboardKeyListener

This class represents the Mc909 sample editor application

Author:
Manu Robledo

Nested Class Summary
(package private)  class Mc909SampleEditor.Left909
          This class overrides the SampleEditor´s Leftbar with a new one adapted to the needs of the Mc909SampleEditor
(package private)  class Mc909SampleEditor.Properties
          This class represents the special properties of MC909 sample files.
 
Nested classes inherited from class com.groovemanager.app.sse.SimpleSampleEditor
SimpleSampleEditor.AudioPlayerPositionReader, SimpleSampleEditor.LeftBar
 
Nested classes inherited from class org.eclipse.jface.window.Window
org.eclipse.jface.window.Window.IExceptionHandler
 
Field Summary
 
Fields inherited from class com.groovemanager.app.sse.SimpleSampleEditor
configAction, controlBar, copySource, effectActions, fileCloseAction, fileManager, fileOpenAction, fileSaveAction, fileSaveAsAction, keyListener, left, leftBar, listenToWaveDisplay, listenToZoomWaveForm, mainContent, memoryReader, player, positionReader, readMemory, rightBar, sashForm, style, tabFolder, transportBar, waveContent, zoomAll, zoomIn, zoomOut, zoomSel, zoomWaveDisplay
 
Fields inherited from class org.eclipse.jface.window.Window
CANCEL, OK
 
Constructor Summary
Mc909SampleEditor()
          Create a new Mc909SampleEditor in a top level window using the default Filemanager
Mc909SampleEditor(FileManager fileManager)
          Create a new Mc909SampleEditor in a top level window
Mc909SampleEditor(org.eclipse.swt.widgets.Shell shell)
          Create a new Mc909SampleEditor using the default FileManager
Mc909SampleEditor(org.eclipse.swt.widgets.Shell shell, FileManager fileManager)
          Create a new Mc909SampleEditor
Mc909SampleEditor(org.eclipse.swt.widgets.Shell shell, int style)
          Create a new Mc909SampleEditor using the default FileManager
Mc909SampleEditor(org.eclipse.swt.widgets.Shell shell, int style, FileManager fileManager)
          Create a new Mc909SampleEditor
 
Method Summary
protected  ConfigAction createConfigAction()
          Create the action that will be used for "Settings"
protected  org.eclipse.swt.widgets.Control createContents(org.eclipse.swt.widgets.Composite parent)
          This methos must be implemented to create the EditorWindow´s contents
protected  void createControlBarElements(org.eclipse.swt.widgets.Composite comp)
          Create the control bar elements (bottom bar)
protected  void createLeftBarElements(org.eclipse.swt.widgets.Composite comp)
          Create the elements for the left bar
(package private)  void export()
          Open the dialog for importing or exporting samples from/to the Mc909
(package private)  void exportRS()
          Open the wizard for exporting a Rhythm set to the Mc909
 void fileClosed(java.io.File f)
          Notification that the user requested to close a file
 void fileOpened(java.io.File f)
          Notification that the user desired to open a file.
(package private)  Mc909SampleEditor.Properties getActiveProperties()
          Get the Properties instance corresponding to the active WaveTab or null, if no WaveTab is currently active
protected  org.eclipse.swt.graphics.Image getImage()
          Get the icon to be used for this editor
protected  int[] getSashFormWeights()
          Get the weights to be used for the SashForm
protected  java.lang.String getTitle()
          Get the title to be used for the window
(package private)  void importFile(java.io.File sourceSample)
          Import a Sample from the MC909.
 void keyPressed(int key)
          Notification that a KeyboardKey has been pressed
 void keyReleased(int key)
          Notification that a KeyboardKey has been released
 void newFile()
          Notification that the user requested to create a new file.
 
Methods inherited from class com.groovemanager.app.sse.SimpleSampleEditor
copyFile, createEditMenu, createEffectMenu, createFileMenu, createMenuManager, createOptionsMenu, createRightBarElements, createTempFile, createWaveContentElements, editAction, fileSaved, getActiveSource, getActiveTab, getControlBarStyle, getCopySource, getLeftBarStyle, getRightBarStyle, getSashFormStyle, getTabFolderStyle, getTabForFile, getTabItemStyle, getTransportBarStyle, getWaveContentStyle, getWaveDisplay, getWaveStyle, isOpen, open, removeCopySource, saveAudioFile, selectFileTab, setCopySource, setShells, sourceFileChanged, tabActivated, transportBack, transportBackSearch, transportFwd, transportFwdSearch, transportLoop, transportPause, transportPlay, transportRecord, transportStop, viewChanged, zoomAll, zoomIn, zoomOut, zoomSelection
 
Methods inherited from class com.groovemanager.gui.EditorWindow
errorMessage
 
Methods inherited from class org.eclipse.jface.window.ApplicationWindow
addMenuBar, addStatusLine, addToolBar, canHandleShellCloseEvent, close, configureShell, createStatusLineManager, createToolBarControl, createToolBarManager, getFont, getMenuBarManager, getStatusLineManager, getSymbolicFontName, getToolBarControl, getToolBarManager, run, setStatus, toolBarChildrenExist
 
Methods inherited from class org.eclipse.jface.window.Window
constrainShellSize, create, createShell, getContents, getDefaultImage, getInitialLocation, getInitialSize, getParentShell, getReturnCode, getShell, getShellListener, getShellStyle, getWindowManager, handleFontChange, handleShellCloseEvent, initializeBounds, setBlockOnOpen, setDefaultImage, setExceptionHandler, setReturnCode, setShellStyle, setWindowManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Mc909SampleEditor

public Mc909SampleEditor()
Create a new Mc909SampleEditor in a top level window using the default Filemanager


Mc909SampleEditor

public Mc909SampleEditor(FileManager fileManager)
Create a new Mc909SampleEditor in a top level window

Parameters:
fileManager - The FileManager to use

Mc909SampleEditor

public Mc909SampleEditor(org.eclipse.swt.widgets.Shell shell)
Create a new Mc909SampleEditor using the default FileManager

Parameters:
shell - The parent shell. May be null to create a top level window.

Mc909SampleEditor

public Mc909SampleEditor(org.eclipse.swt.widgets.Shell shell,
                         FileManager fileManager)
Create a new Mc909SampleEditor

Parameters:
shell - The parent shell. May be null to create a top level window.
fileManager - The FileManager to use

Mc909SampleEditor

public Mc909SampleEditor(org.eclipse.swt.widgets.Shell shell,
                         int style)
Create a new Mc909SampleEditor using the default FileManager

Parameters:
shell - The parent shell. May be null to create a top level window.
style - The window´s style

Mc909SampleEditor

public Mc909SampleEditor(org.eclipse.swt.widgets.Shell shell,
                         int style,
                         FileManager fileManager)
Create a new Mc909SampleEditor

Parameters:
shell - The parent shell. May be null to create a top level window.
style - The window´s style
fileManager - The FileManager to use
Method Detail

createConfigAction

protected ConfigAction createConfigAction()
Description copied from class: SimpleSampleEditor
Create the action that will be used for "Settings"

Overrides:
createConfigAction in class SimpleSampleEditor
Returns:
The action that will be used for "Settings"
See Also:
SimpleSampleEditor.createConfigAction()

createContents

protected org.eclipse.swt.widgets.Control createContents(org.eclipse.swt.widgets.Composite parent)
Description copied from class: EditorWindow
This methos must be implemented to create the EditorWindow´s contents

Overrides:
createContents in class SimpleSampleEditor
See Also:
Window.createContents(org.eclipse.swt.widgets.Composite)

createControlBarElements

protected void createControlBarElements(org.eclipse.swt.widgets.Composite comp)
Description copied from class: SimpleSampleEditor
Create the control bar elements (bottom bar)

Overrides:
createControlBarElements in class SimpleSampleEditor
Parameters:
comp - The parent composite
See Also:
SimpleSampleEditor.createControlBarElements(org.eclipse.swt.widgets.Composite)

createLeftBarElements

protected void createLeftBarElements(org.eclipse.swt.widgets.Composite comp)
Description copied from class: SimpleSampleEditor
Create the elements for the left bar

Overrides:
createLeftBarElements in class SimpleSampleEditor
Parameters:
comp - The parent Composite
See Also:
SimpleSampleEditor.createLeftBarElements(org.eclipse.swt.widgets.Composite)

export

void export()
Open the dialog for importing or exporting samples from/to the Mc909


exportRS

void exportRS()
Open the wizard for exporting a Rhythm set to the Mc909


fileClosed

public void fileClosed(java.io.File f)
Description copied from interface: FileCloseListener
Notification that the user requested to close a file

Specified by:
fileClosed in interface FileCloseListener
Overrides:
fileClosed in class SimpleSampleEditor
Parameters:
f - The file to be closed
See Also:
FileCloseListener.fileClosed(java.io.File)

fileOpened

public void fileOpened(java.io.File f)
Description copied from interface: FileOpenListener
Notification that the user desired to open a file. When multiple files should be opened, this method will be called once for each file.

Specified by:
fileOpened in interface FileOpenListener
Overrides:
fileOpened in class SimpleSampleEditor
Parameters:
f - The file to be opened
See Also:
FileOpenListener.fileOpened(java.io.File)

getActiveProperties

Mc909SampleEditor.Properties getActiveProperties()
Get the Properties instance corresponding to the active WaveTab or null, if no WaveTab is currently active

Returns:
The Properties instance for the currently active WaveTab

getImage

protected org.eclipse.swt.graphics.Image getImage()
Description copied from class: SimpleSampleEditor
Get the icon to be used for this editor

Overrides:
getImage in class SimpleSampleEditor
Returns:
The icon to be used for this editor
See Also:
SimpleSampleEditor.getImage()

getSashFormWeights

protected int[] getSashFormWeights()
Description copied from class: SimpleSampleEditor
Get the weights to be used for the SashForm

Overrides:
getSashFormWeights in class SimpleSampleEditor
Returns:
The weights to be used for the SashForm
See Also:
SimpleSampleEditor.getSashFormWeights()

getTitle

protected java.lang.String getTitle()
Description copied from class: SimpleSampleEditor
Get the title to be used for the window

Overrides:
getTitle in class SimpleSampleEditor
Returns:
The window title to be used
See Also:
SimpleSampleEditor.getTitle()

importFile

void importFile(java.io.File sourceSample)
          throws java.io.IOException,
                 NotFinishedException
Import a Sample from the MC909. The sample will be copied to a temporary file and then opened.

Parameters:
sourceSample - The sample file to import
Throws:
java.io.IOException - If an I/O error occurs
NotFinishedException - If the Copy process did not finish

keyPressed

public void keyPressed(int key)
Description copied from interface: KeyboardKeyListener
Notification that a KeyboardKey has been pressed

Specified by:
keyPressed in interface KeyboardKeyListener
Parameters:
key - The note value of the key that has been pressed in the range from 0 to 127
See Also:
KeyboardKeyListener.keyPressed(int)

keyReleased

public void keyReleased(int key)
Description copied from interface: KeyboardKeyListener
Notification that a KeyboardKey has been released

Specified by:
keyReleased in interface KeyboardKeyListener
Parameters:
key - The note value of the key that has been released in the range from 0 to 127
See Also:
KeyboardKeyListener.keyReleased(int)

newFile

public void newFile()
Description copied from interface: FileNewListener
Notification that the user requested to create a new file.

Specified by:
newFile in interface FileNewListener
Overrides:
newFile in class SimpleSampleEditor
See Also:
FileNewListener.newFile()