public class SoundcheckInstrumentModel extends MidicaTableModel
This class provides the model for the instruments table in the soundcheck window.
The instruments from the currently loaded soundbank are displayed only if they support the selected channel.
If chromatic instruments are supported, the according sub categories are displayed as well.
Modifier and Type | Field and Description |
---|---|
private java.util.ArrayList<java.util.HashMap<java.lang.String,java.lang.String>> |
instrumentList |
private java.util.HashMap<java.lang.String,java.lang.Boolean> |
isSubCatUsed |
private java.util.TreeMap<java.lang.Integer,java.lang.String> |
programToSubCat |
private static long |
serialVersionUID |
columnClasses, columnNames, sortableColumns
Constructor and Description |
---|
SoundcheckInstrumentModel()
Creates a model for the instruments table.
|
Modifier and Type | Method and Description |
---|---|
java.util.ArrayList<java.util.HashMap<java.lang.String,?>> |
getCategorizedHashMapRows()
Returns null, if not overridden by a child model class.
|
java.util.ArrayList<java.util.HashMap<java.lang.String,java.lang.String>> |
getInstruments()
Returns the current list of instruments to be displayed in the table.
|
int |
getRowCount()
Returns the number of table rows.
|
java.lang.Object |
getValueAt(int row,
int col)
Returns the value of the queried table cell.
|
void |
initList()
Builds up the structure of available soundbank instruments and/or drumkits that support the currently selected channel.
|
private void |
initSubCategories()
Initializes the data structures for sub categories of chromatic instruments.
|
private static boolean |
isChannelSupported(int channel,
java.util.HashMap<java.lang.String,java.lang.String> instr)
Determins if the given channel is supported by the given instrument.
|
getCategorizedRows, getColumnClass, getColumnCount, getColumnName, getHeaderTooltip, isCellEditable, isSortable, setHeaderToolTip
addColumn, addColumn, addColumn, addRow, addRow, convertToVector, convertToVector, getDataVector, insertRow, insertRow, moveRow, newDataAvailable, newRowsAdded, removeRow, rowsRemoved, setColumnCount, setColumnIdentifiers, setColumnIdentifiers, setDataVector, setDataVector, setNumRows, setRowCount, setValueAt
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
private static final long serialVersionUID
private java.util.ArrayList<java.util.HashMap<java.lang.String,java.lang.String>> instrumentList
private java.util.TreeMap<java.lang.Integer,java.lang.String> programToSubCat
private java.util.HashMap<java.lang.String,java.lang.Boolean> isSubCatUsed
public SoundcheckInstrumentModel()
Creates a model for the instruments table.
public void initList()
Builds up the structure of available soundbank instruments and/or drumkits that support the currently selected channel.
This is called whenever the channel selection changes.
private static boolean isChannelSupported(int channel, java.util.HashMap<java.lang.String,java.lang.String> instr)
Determins if the given channel is supported by the given instrument.
channel
- MIDI channelinstr
- Instrument structure as it is parsed from the soundbank.public int getRowCount()
MidicaTableModel
Returns the number of table rows.
getRowCount
in interface javax.swing.table.TableModel
getRowCount
in class MidicaTableModel
public java.lang.Object getValueAt(int row, int col)
MidicaTableModel
Returns the value of the queried table cell.
getValueAt
in interface javax.swing.table.TableModel
getValueAt
in class MidicaTableModel
row
- Row index.col
- Column index.public java.util.ArrayList<java.util.HashMap<java.lang.String,?>> getCategorizedHashMapRows()
MidicaTableModel
Returns null, if not overridden by a child model class. Can be overridden to return the underlying data list, if it contains categorized data. That’s needed for the sorter to be able to hide categories, if the sorting is different from the model’s default sorting.
getCategorizedHashMapRows
in class MidicaTableModel
public java.util.ArrayList<java.util.HashMap<java.lang.String,java.lang.String>> getInstruments()
Returns the current list of instruments to be displayed in the table.
private void initSubCategories()
Initializes the data structures for sub categories of chromatic instruments.