1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257
|
#
# This file is part of tk707.
#
# Copyright (C) 2000, 2001, 2002, 2003, 2004 Chris Willing and Pierre Saramito
#
# tk707 is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# Foobar is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Foobar; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# =========================================================================
# File gui.tcl
# GUI for TK-707
# =========================================================================
eval destroy [winfo child .]
wm title . "TK-707"
set font {Helvetica 14}
wm iconify .
# -------------------------------------------------------------------------
# menu bar
# -------------------------------------------------------------------------
frame .mbar -borderwidth 1p -relief raised
pack .mbar -fill x
menubutton .mbar.file -text "File" -menu .mbar.file.m
menubutton .mbar.midi -text "Midi" -menu .mbar.midi.m
menubutton .mbar.map -text "Map" -menu .mbar.map.m
pack .mbar.file -side left
pack .mbar.midi -side left
pack .mbar.map -side left
menubutton .mbar.help -text "Help" -menu .mbar.help.m
pack .mbar.help -side right
# -----------------------------------------------------------------------------
# file menu
# -----------------------------------------------------------------------------
menu .mbar.file.m -tearoff 0
.mbar.file.m add command -label "Load Data" -command {load_data_file "."} \
-underline 0 \
-accelerator "Ctrl-O"
.mbar.file.m add command -label "Load Demo" -command {load_data_file $PKGDATADIR} \
-underline 0
.mbar.file.m add command -label "Save Data" -command {save_data_file} \
-underline 0 \
-accelerator "Ctrl-S"
.mbar.file.m add command -label "Ports" -command {port_setup} \
-underline 0
.mbar.file.m add command -label "Quit" -command "exit" \
-underline 0 \
-accelerator "Ctrl-Q"
bind . <Control-q> { exit;}
bind . <Control-o> { load_data_file ".";}
bind . <Control-s> { save_data_file;}
# -----------------------------------------------------------------------------
# midi & map menus
# -----------------------------------------------------------------------------
menu .mbar.midi.m -tearoff 0
menu .mbar.map.m -tearoff 0
.mbar.midi.m add command -label "Save Midi Track" -command {save_midi_file} -underline 0
.mbar.midi.m add command -label "Set MIDI Channel" -command {ac_midi} -underline 0
.mbar.map.m add command -label "Load Standard Sound Map" -command {load_sound_map $PKGDATADIR} -underline 0
.mbar.map.m add command -label "Load Local Sound Map" -command {load_sound_map "."} -underline 0
.mbar.map.m add command -label "Save Sound Map" -command {save_sound_map} -underline 0
.mbar.map.m add command -label "Edit Sound Map" -command {map_edit} -underline 0
.mbar.map.m add command -label "Edit Fader Map" -command {fader_edit} -underline 0
# TODO: next will put names on patterns for automatic score generation...
# menu .mbar.pattern -tearoff 0
# .mbar add cascade -menu .mbar.pattern -label "Pattern" -underline 0
# .mbar.pattern add command -label "Edit Comment" -command {edit_pattern_comment} -underline 0
# -----------------------------------------------------------------------------
# help menu
# -----------------------------------------------------------------------------
menu .mbar.help.m -tearoff 0
.mbar.help.m add command -label "About" -command {about} -underline 0
.mbar.help.m add command -label "User's Manual" -command {UserManual} -underline 0
. configure -menu .mbar
# =========================================================================
# Frame for Grid & Volume controls
# =========================================================================
set grid_vols .gv
eval frame $grid_vols $debug_relief
pack $grid_vols -anchor c
# --------------------------------------------------------------------------
# Grid Display
# --------------------------------------------------------------------------
set display $grid_vols.d
frame $display -relief groove -borderwidth 2p
pack $display -side left
frame $display.g
pack $display.g ;#-side left
set gridlabel $display.g.l ; # Instrument label
canvas $gridlabel -width 3c -height 9.0c
set grid $display.g.c ; # Pattern Grid
canvas $grid -width 8.5c -height 9.0c
pack $gridlabel $grid -side left
# --------------------------------------------------------------------------
# Status area
# --------------------------------------------------------------------------
set infosection $display.i ; # to contain Tempo, Track & Mode widgets
frame $infosection
pack $infosection -side bottom
set tempoinfo $infosection.t
set tminfo $infosection.tm
frame $tminfo
canvas $tempoinfo -width 4c -height 2c -relief groove -borderwidth 2
canvas $tminfo.t -width 7.5c -height 0.75c -relief groove -borderwidth 2
canvas $tminfo.m -width 7.5c -height 1.25c -relief groove -borderwidth 2
pack $tminfo.t $tminfo.m
pack $tempoinfo $tminfo -side left -expand true -fill y
# --------------------------------------------------------------------------
# Volume controls
# --------------------------------------------------------------------------
set vcunit $grid_vols.cu
eval frame $vcunit $debug_relief
pack $vcunit -side left
#
# Controls + Notes Staff
#
set ctrls_notes_staff .cns
frame $ctrls_notes_staff
pack $ctrls_notes_staff -expand true -fill x
# ==========================================================================
# Controls
# ==========================================================================
set ctrl_height 4.0;
set ctrls $ctrls_notes_staff.c
frame $ctrls
pack $ctrls -side top -expand true -fill x
# ---------------------------------------
# Scale lamps + Score + Notes/Instruments
# ---------------------------------------
set notes_staff $ctrls_notes_staff.ns
frame $notes_staff
pack $notes_staff -anchor s
# ---------------------------------------
# Transport control (Start/Cont)
# ---------------------------------------
set stop_box $ctrls.stop_box
eval canvas $stop_box -width 2.3c -height ${ctrl_height}c $debug_relief;
pack $stop_box -side left -anchor n ;
set button_stop $stop_box.stop
label $stop_box.lt -text STOP/CONT -font *-${boldfont13}-*
radiobutton $button_stop -bitmap nix -width 1.45c -height 2.6c \
-variable ss -value stop -indicatoron false \
-bg $tkxox(but_grey) -activebackground $tkxox(but_grey_active) \
-selectcolor $tkxox(but_grey_active) \
-command "ac_stopgo $tkxox(CONT)"
$stop_box create window 1.25c 0.4c -window $stop_box.lt
$stop_box create window 1.25c 2.2c -window $button_stop
bind all <space> {
if {$mode(stopgo) == $tkxox(START)} {
$button_stop invoke
} else {
ac_stopgo $tkxox(START)
$button_start invoke
}
}
#
# Transport control (start)
#
set start_box $notes_staff.start_box
canvas $start_box -width 2.3c -height 4.5c ;#-relief groove -borderwidth 4
pack $start_box -side left -anchor n ;#-expand true -fill y
set button_start $start_box.start
label $start_box.lb -text START -font *-${boldfont13}-*
radiobutton $button_start -bitmap nix -width 1.45c -height 2.6c \
-variable ss -value start -indicatoron false \
-bg $tkxox(but_grey) -activebackground $tkxox(but_grey_active) \
-selectcolor $tkxox(but_grey_active)
$start_box create window 1.25c 0.4c -window $start_box.lb
$start_box create window 1.25c 2.1c -window $button_start
bind $button_start <1> {ac_stopgo $tkxox(START)}
# ================================================================
# button controls
# ================================================================
set space_width 2.8;
set misc_width 5.0;
set st_width 4.0;
set trpa_width 3.0;
set grp_width 5.0;
set accent_width 2.6;
#
# Empty Space : adjust vectical alignment with score
#
set empty_case $ctrls.z
eval canvas $empty_case -width ${space_width}c -height ${ctrl_height}c \
$debug_relief;
pack $empty_case -side left -anchor nw ;
#
# Clear/Scale/Last Step/Instrument Guide
#
set misc $ctrls.misc
eval canvas $misc -width ${misc_width}c -height ${ctrl_height}c $debug_relief;
pack $misc -side left -anchor n
#
# Shuffle/Flam Tempo/Measure controls
#
set st $ctrls.st
eval canvas $st -width ${st_width}c -height ${ctrl_height}c $debug_relief;
pack $st -side left -anchor n
#
# Track/Pattern Read/Write Control
#
set trpa $ctrls.trpa
eval canvas $trpa -width 3c -height ${ctrl_height}c $debug_relief;
pack $trpa -side left -anchor n
#
# Pattern Group & Track Number selection
#
set grps $ctrls.grps
eval canvas $grps -width 5c -height ${ctrl_height}c $debug_relief;
pack $grps -side left -anchor n
#
# Accent/Enter
#
set accenter $ctrls.accenter
eval canvas $accenter -width 2.6c -height ${ctrl_height}c $debug_relief;
pack $accenter -side left -anchor n
#
# Tempo Dial
#
set dial $ctrls.dial
eval frame $dial $debug_relief
pack $dial -side left -expand true;
# ---------------------------
# Score + Notes/Instruments
# ---------------------------
set note_score $notes_staff.sc
eval frame $note_score $debug_relief;
pack $note_score
# ---------------------------
# Notes/Instruments
# ---------------------------
set notes $notes_staff.n;
eval frame $notes $debug_relief;
pack $notes -anchor w -side left
|