]> ruin.nu Git - moosique.git/commitdiff
Changed beginnings of comments from /* to /** which is necessary for the comments...
authorEinar Pehrson <einarp@itstud.chalmers.se>
Tue, 29 Apr 2003 01:00:34 +0000 (01:00 +0000)
committerEinar Pehrson <einarp@itstud.chalmers.se>
Tue, 29 Apr 2003 01:00:34 +0000 (01:00 +0000)
14 files changed:
MooGUI.java
MooInstrumentList.java
MooKeyboard.java
MooMenu.java
MooNote.java
MooNoteElement.java
MooNoteProp.java
MooStatus.java
MooToolbar.java
MooTrackTitle.java
MooTrackView.java
MooView.java
MooViewCounter.java
Moosique.java

index 60bb7aca9ed424b63c7231a7010109f54cfb81d2..cc145ab4a57f4e3f2603094aa8300c7152a6f51e 100644 (file)
@@ -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
         */
index 1864b690d4345fef3e3754f8cff86010045af513..6f0211fa4931784707135b2bf4c92c048d014244 100644 (file)
@@ -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
index 0ebfa63f063dd6f0cec8aeda527594d63156e0bd..67664dfb1298db17435907fb07b81f4aec17dd1b 100644 (file)
@@ -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
index d1794d2f5faf4b37978832436d15c4b541bb9b1f..664d8a2ad5403ea7b6251307d09bee3112f52e86 100644 (file)
@@ -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 () {
index 20047887f107cd03093927f86c2fb8851b37fe27..6ea6c39b6b6bfb369d6feca755dc194846dc5f06 100644 (file)
@@ -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
         */
index 8b71b3cfb31e72caabf1edff3479f1dd930beecf..b42bcb96e73f2a2b532ae28e72b02d79cfe3f248 100644 (file)
@@ -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)
index 97711ec5cbe6e9a883656797609237d360520670..e2a8ed22fa9a5bf404daa23ebd866d03ededa443 100644 (file)
@@ -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
         */
index 5ea299df2c25fa4feb102dd79d838ff788e224fe..c04325a3933f2ec2d5d1e431bac2c8de0fde6f5d 100644 (file)
@@ -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 () {
index a2a22431714c3061470d52e4cfd3797a56be1bf1..5eae4772a3b12120f0a4ea6777c500a4af00ae37 100644 (file)
@@ -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 () {
index 522de6504b32c045412d6f199e4c8799c89cac36..25f54a144d52dd9277e28d36283e85f7bb9f4611 100644 (file)
@@ -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 () {
index de73c8cd48b376ba808aaebb45e98fd21ae43416..04b675583b3aa18bf50406026be52cda4f350d0e 100644 (file)
@@ -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 () {
index 81357550d44e1bdd21186351ef82820073234f19..1cdbee8c36d7462569420d62aa640c9724a6b4d7 100644 (file)
@@ -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 () {
index 237d52313f8e53afa96dd5a4ea33a81b2b34dd04..aea79444a2e36e44b5255e1598d59f9a4d192b5e 100644 (file)
@@ -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 () {
index 32c4d375d7e43b0f7b502d0b6b25730f8b0e6771..c411cd6f38cf779e74dda15f66bb68a6856a77db 100644 (file)
@@ -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