From d7666fadd2f8baca8a03cacae836f2563fe4dd5d Mon Sep 17 00:00:00 2001 From: Einar Pehrson Date: Tue, 29 Apr 2003 01:00:34 +0000 Subject: [PATCH] Changed beginnings of comments from /* to /** which is necessary for the comments to be used in javadoc. --- MooGUI.java | 6 ++--- MooInstrumentList.java | 2 +- MooKeyboard.java | 8 +++---- MooMenu.java | 4 ++-- MooNote.java | 28 +++++++++++------------ MooNoteElement.java | 6 ++--- MooNoteProp.java | 4 ++-- MooStatus.java | 4 ++-- MooToolbar.java | 4 ++-- MooTrackTitle.java | 4 ++-- MooTrackView.java | 4 ++-- MooView.java | 4 ++-- MooViewCounter.java | 4 ++-- Moosique.java | 52 +++++++++++++++++++----------------------- 14 files changed, 65 insertions(+), 69 deletions(-) diff --git a/MooGUI.java b/MooGUI.java index 60bb7ac..cc145ab 100644 --- a/MooGUI.java +++ b/MooGUI.java @@ -3,7 +3,7 @@ import javax.swing.*; import java.awt.*; import java.awt.event.*; -/* +/** * Moosique's graphical user interface. * * @author Mikael Andreen @@ -13,7 +13,7 @@ public class MooGUI extends JFrame implements WindowListener { Sequence seq; - /* + /** * Creates the GUI. */ public MooGUI(Sequence seq) { @@ -31,7 +31,7 @@ public class MooGUI extends JFrame implements WindowListener { setVisible(true); } - /* + /** * Changes the sequence of the GUI. * @param sequence the MIDI sequence to visualize */ diff --git a/MooInstrumentList.java b/MooInstrumentList.java index 1864b69..6f0211f 100644 --- a/MooInstrumentList.java +++ b/MooInstrumentList.java @@ -3,7 +3,7 @@ import javax.swing.*; import java.awt.*; import java.awt.event.*; -/* +/** * A Combo Box where the instrument of the currently active channel can be selected. * * @author Einar Pehrson diff --git a/MooKeyboard.java b/MooKeyboard.java index 0ebfa63..67664df 100644 --- a/MooKeyboard.java +++ b/MooKeyboard.java @@ -1,7 +1,7 @@ import javax.sound.midi.*; import java.awt.event.*; -/* +/** * Functional representation of a MIDI note, which contains two MIDI events, note on and note off. * * @author Einar Pehrson @@ -13,7 +13,7 @@ public class MooKeyboard extends KeyAdapter { private static final int startNote = 48; private static final int[] keyToNote = new int[120]; - /* + /** * Plays the appropriate MIDI NoteOn event. */ public void keyPressed(KeyEvent e) { @@ -28,7 +28,7 @@ public class MooKeyboard extends KeyAdapter { } } - /* + /** * Plays the appropriate MIDI NoteOff event. */ public void keyReleased(KeyEvent e) { @@ -43,7 +43,7 @@ public class MooKeyboard extends KeyAdapter { } } - /* Maps keycodes (array indices) to MIDI note numbers using the following layout: + /** Maps keycodes (array indices) to MIDI note numbers using the following layout: * * 2 3 5 6 7 9 0 => # # # # # # # * q w e r t y u i o p => c d e f g a b c d e diff --git a/MooMenu.java b/MooMenu.java index d1794d2..664d8a2 100644 --- a/MooMenu.java +++ b/MooMenu.java @@ -1,6 +1,6 @@ import javax.swing.*; -/* +/** * * * @author Andersson, Andreen, Lanneskog, Pehrson @@ -9,7 +9,7 @@ import javax.swing.*; public class MooMenu { - /* + /** * Creates the menus. */ public MooMenu () { diff --git a/MooNote.java b/MooNote.java index 2004788..6ea6c39 100644 --- a/MooNote.java +++ b/MooNote.java @@ -1,6 +1,6 @@ import javax.sound.midi.*; -/* +/** * Functional representation of a MIDI note, which adds functionality to the existent MidiEvent class. * Also provides a reference to the corresponding NoteOff event. * @@ -12,7 +12,7 @@ public class MooNote extends MidiEvent { protected MidiEvent noteOffEvent; protected ShortMessage noteOnMsg, noteOffMsg; - /* + /** * Creates a MooNote from the given NoteOn event in the current track. * @param noteOnEvent the NoteOn event of the note */ @@ -21,7 +21,7 @@ public class MooNote extends MidiEvent { noteOnMsg = (ShortMessage)getMessage(); } - /* + /** * Creates a MooNote from the given NoteOn event in the current track and creates a reference to * the corresponding NoteOff event. * @param noteOnEvent the NoteOn event of the note @@ -34,7 +34,7 @@ public class MooNote extends MidiEvent { noteOffMsg = (ShortMessage)noteOffEvent.getMessage(); } - /* + /** * Creates a MooNote of the given pitch, velocity and duration in the current track. * @param track the track to which the MooNote was added * @param channel the channel of the note (1-16) @@ -54,7 +54,7 @@ public class MooNote extends MidiEvent { } catch (InvalidMidiDataException e) {} } - /* + /** * Sets the channel of the current note. * @param channel the channel of the note (1-16) */ @@ -65,7 +65,7 @@ public class MooNote extends MidiEvent { } catch (InvalidMidiDataException e) {} } - /* + /** * Sets the pitch of the current note. * @param pitch the pitch of the note (0-127) */ @@ -76,7 +76,7 @@ public class MooNote extends MidiEvent { } catch (InvalidMidiDataException e) {} } - /* + /** * Sets the velocity of the current note. * @param vel the velocity of the note (0-127) */ @@ -87,7 +87,7 @@ public class MooNote extends MidiEvent { } catch (InvalidMidiDataException e) {} } - /* + /** * Sets the duration of the current note (or rather moves the note off event). * @param n the duration of the note in ticks (96 per beat) */ @@ -95,7 +95,7 @@ public class MooNote extends MidiEvent { if (hasNoteOffEvent()) noteOffEvent.setTick(getTick() + ticks); } - /* + /** * Sets the timestamp of the current note. * @param tick the timestamp of the note in ticks (96 per beat) */ @@ -104,7 +104,7 @@ public class MooNote extends MidiEvent { super.setTick(tick); } - /* + /** * Returns the channel of the current note. * @return the channel of the note (1-16) */ @@ -112,7 +112,7 @@ public class MooNote extends MidiEvent { return noteOnMsg.getChannel(); } - /* + /** * Returns the pitch of the current note. * @return the pitch of the note (0-127) */ @@ -120,7 +120,7 @@ public class MooNote extends MidiEvent { return noteOnMsg.getData1(); } - /* + /** * Returns the velocity of the current note. * @return the velocity of the note (0-127) */ @@ -128,7 +128,7 @@ public class MooNote extends MidiEvent { return noteOnMsg.getData2(); } - /* + /** * Returns the duration of the current note. * @return the duration of the note (in ticks) */ @@ -137,7 +137,7 @@ public class MooNote extends MidiEvent { return (int)(getTick() - noteOffEvent.getTick()); } - /* + /** * Returns whether the NoteOff event was found. * @return the note off MidiEvent */ diff --git a/MooNoteElement.java b/MooNoteElement.java index 8b71b3c..b42bcb9 100644 --- a/MooNoteElement.java +++ b/MooNoteElement.java @@ -2,7 +2,7 @@ import javax.swing.*; import java.awt.*; import java.awt.event.*; -/* +/** * Graphical representation of a MIDI note. * * @author Andersson, Andreen, Lanneskog, Pehrson @@ -12,7 +12,7 @@ import java.awt.event.*; public class MooNoteElement extends JPanel{ private MooNote note; - /* + /** * Creates a new note element. * @param mn The note that will be graphically represented */ @@ -42,7 +42,7 @@ public class MooNoteElement extends JPanel{ } - /** + /*** * */ public void paintComponent(Graphics g) diff --git a/MooNoteProp.java b/MooNoteProp.java index 97711ec..e2a8ed2 100644 --- a/MooNoteProp.java +++ b/MooNoteProp.java @@ -2,7 +2,7 @@ import javax.swing.*; import java.awt.*; import java.awt.event.*; -/* +/** * Graphical representation of a MIDI note. * * @author Andersson, Andreen, Lanneskog, Pehrson @@ -12,7 +12,7 @@ import java.awt.event.*; public class MooNoteProp extends JDialog{ private MooNote note; - /* + /** * Creates a new note preference dialog. * @param mn The note that will be graphically represented */ diff --git a/MooStatus.java b/MooStatus.java index 5ea299d..c04325a 100644 --- a/MooStatus.java +++ b/MooStatus.java @@ -1,6 +1,6 @@ import javax.swing.*; -/* +/** * * * @author Andersson, Andreen, Lanneskog, Pehrson @@ -9,7 +9,7 @@ import javax.swing.*; public class MooStatus { - /* + /** * Creates the status bar. */ public MooStatus () { diff --git a/MooToolbar.java b/MooToolbar.java index a2a2243..5eae477 100644 --- a/MooToolbar.java +++ b/MooToolbar.java @@ -1,6 +1,6 @@ import javax.swing.*; -/* +/** * * * @author Andersson, Andreen, Lanneskog, Pehrson @@ -9,7 +9,7 @@ import javax.swing.*; public class MooToolbar { - /* + /** * Creates the toolbar. */ public MooToolbar () { diff --git a/MooTrackTitle.java b/MooTrackTitle.java index 522de65..25f54a1 100644 --- a/MooTrackTitle.java +++ b/MooTrackTitle.java @@ -1,6 +1,6 @@ import javax.swing.*; -/* +/** * The title bar for each track with track name, channel, instrument etc. * * @author Andersson, Andreen, Lanneskog, Pehrson @@ -9,7 +9,7 @@ import javax.swing.*; public class MooTrackTitle { - /* + /** * Creates the title bar. */ public MooTrackTitle () { diff --git a/MooTrackView.java b/MooTrackView.java index de73c8c..04b6755 100644 --- a/MooTrackView.java +++ b/MooTrackView.java @@ -1,6 +1,6 @@ import javax.swing.*; -/* +/** * * * @author Andersson, Andreen, Lanneskog, Pehrson @@ -9,7 +9,7 @@ import javax.swing.*; public class MooTrackView { - /* + /** * Creates */ public MooTrackView () { diff --git a/MooView.java b/MooView.java index 8135755..1cdbee8 100644 --- a/MooView.java +++ b/MooView.java @@ -1,6 +1,6 @@ import javax.swing.*; -/* +/** * * * @author Andersson, Andreen, Lanneskog, Pehrson @@ -9,7 +9,7 @@ import javax.swing.*; public class MooView { - /* + /** * Creates */ public MooView () { diff --git a/MooViewCounter.java b/MooViewCounter.java index 237d523..aea7944 100644 --- a/MooViewCounter.java +++ b/MooViewCounter.java @@ -1,6 +1,6 @@ import javax.swing.*; -/* +/** * * * @author Andersson, Andreen, Lanneskog, Pehrson @@ -9,7 +9,7 @@ import javax.swing.*; public class MooViewCounter { - /* + /** * Creates */ public MooViewCounter () { diff --git a/Moosique.java b/Moosique.java index 32c4d37..c411cd6 100644 --- a/Moosique.java +++ b/Moosique.java @@ -2,7 +2,7 @@ import javax.sound.midi.*; import javax.swing.*; import java.io.*; -/* +/** * Moosique - The MIDI Tracker * * Main class that handles initiation, IO and sound. @@ -15,15 +15,15 @@ public class Moosique { protected static MooGUI gui; protected static Sequence seq; - protected static Sequencer sequencer = null; - protected static Synthesizer synthesizer = null; + protected static Sequencer sequencer; + protected static Synthesizer synthesizer; protected static MidiChannel[] channels; protected static MidiChannel activeChannel; protected static String filename; protected static long position; - /* + /** * Starts the application. */ public static void main (String[] args) { @@ -62,7 +62,7 @@ public class Moosique { System.out.println("Done"); } - /* + /** * Returns a pointer to the current sequence. * @return the current sequence */ @@ -70,7 +70,7 @@ public class Moosique { return seq; } - /* + /** * Returns a pointer to the MidiChannels of the selected synthesizer. * @return the available MidiChannels */ @@ -78,7 +78,7 @@ public class Moosique { return channels; } - /* + /** * Returns a pointer to the currently active MidiChannel. * @return the active MidiChannel */ @@ -86,7 +86,7 @@ public class Moosique { return activeChannel; } - /* + /** * Sets the currently active MidiChannel. * @param channel the number of the MidiChannel to activate */ @@ -94,7 +94,7 @@ public class Moosique { activeChannel = channels[channel]; } - /* + /** * Replaces the current sequence with a new one, holding three empty tracks. */ public static void clearSequence() { @@ -107,7 +107,7 @@ public class Moosique { } - /* + /** * Starts playback of the current sequence. */ public static void play() { @@ -118,21 +118,21 @@ public class Moosique { sequencer.start(); } - /* + /** * Pauses playback of the current sequence. */ public static void pause() { sequencer.stop(); } - /* + /** * Resumes playback of the current sequence. */ public static void resume() { sequencer.start(); } - /* + /** * Stops playback of the current sequence. */ public static void stop() { @@ -140,7 +140,7 @@ public class Moosique { sequencer.setTickPosition(position); } - /* + /** * Rewinds the current sequence the given number of measures. * @param measures the number of measures to rewind */ @@ -148,7 +148,7 @@ public class Moosique { return position; } - /* + /** * Rewinds the current sequence the given number of measures. * @param measures the number of measures to rewind */ @@ -156,7 +156,7 @@ public class Moosique { position = ticks; } - /* + /** * Rewinds the current sequence the given number of measures. * @param measures the number of measures to rewind */ @@ -164,7 +164,7 @@ public class Moosique { position -= ticks; } - /* + /** * Fast forwards the current sequence the given number of measures. * @param measures the number of measures to fast forward */ @@ -172,7 +172,7 @@ public class Moosique { position += ticks; } - /* + /** * Loads the MooSequence in the given file. * @param filename the filename to use */ @@ -184,7 +184,7 @@ public class Moosique { } catch (InvalidMidiDataException e) { return false; } catch (IOException e) { - JOptionPane.showMessageDialog(null, "File", "alert", JOptionPane.ERROR_MESSAGE); + JOptionPane.showMessageDialog(null, "Error 404", "File Not Found", JOptionPane.ERROR_MESSAGE); return false; } @@ -227,31 +227,27 @@ public class Moosique { return true; } - /* + /** * Saves the current sequence to the given filename * @param filename the filename to use */ public static void saveAs(String filename) throws IOException { MidiSystem.write(seq, 1, new File(filename)); - } - /* + /** * Saves the current sequence to the previously given filename. */ public static void save() throws IOException { saveAs(filename); } - /* + /** * Releases all reserved devices and exits the program. */ public static void quit() { - if (sequencer.isOpen()) { - try { - sequencer.open(); - } catch (MidiUnavailableException e) {} - } + if (sequencer.isOpen()) sequencer.close(); + if (synthesizer.isOpen()) synthesizer.close(); System.exit(0); } } \ No newline at end of file -- 2.39.2