source: trunk/src/org/apollo/widgets/TrackWidgetCommons.java@ 1561

Last change on this file since 1561 was 1561, checked in by davidb, 3 years ago

A set of changes that spans three things: beat detection, time stretching; and a debug class motivated by the need to look at a canvas redraw issue most notable when a waveform widget is playing

File size: 1.7 KB
Line 
1package org.apollo.widgets;
2
3import org.expeditee.core.Colour;
4import org.expeditee.core.Font;
5
6public final class TrackWidgetCommons {
7
8 /** Static-only class. */
9 private TrackWidgetCommons()
10 {
11 }
12
13 /** For parsing metadata */
14 public static final String META_NAME_TAG = "name=";
15 public static final String META_INITIATIONTIME_TAG = "it=";
16 public static final String META_RUNNINGMSTIME_TAG = "rt=";
17 public static final String META_LAST_WIDTH_TAG = "lw=";
18 public static final String META_OMIT_LAYOUT_TAG = "dontlayout";
19 public static final String META_BEAT_DETECT_TAG="beatDetect=";
20
21
22 public static final int CACHE_DEPTH = 1;
23
24 public static final Colour FREESPACE_TRACKNAME_TEXT_COLOR = Colour.WHITE;
25 public static final Font FREESPACE_TRACKNAME_FONT = new Font("Arial", Font.Style.BOLD, 20);
26
27 public static final int POPUP_LIFETIME = 1500;
28
29 public static final Colour STANDARD_TRACK_EDGE_COLOR = Colour.BLACK;
30 public static final Colour MUTED_TRACK_EDGE_COLOR = Colour.GREY;
31 public static final Colour SOLO_TRACK_EDGE_COLOR = Colour.RED;
32 public static final Colour MUTED_SOLO_TRACK_EDGE_COLOR = Colour.FromRGB255(255, 168, 168);
33
34 public static final float STOPPED_TRACK_EDGE_THICKNESS = 1.0f;
35 public static final float PLAYING_TRACK_EDGE_THICKNESS = 4.0f;
36
37
38 public static Colour getBorderColor(boolean isSolo, boolean isMuted) {
39
40 Colour newC = null;
41
42 if (isSolo && isMuted) {
43 newC = TrackWidgetCommons.MUTED_SOLO_TRACK_EDGE_COLOR;
44 } else if (isSolo) {
45 newC = TrackWidgetCommons.SOLO_TRACK_EDGE_COLOR;
46 } else if (isMuted) {
47 newC = TrackWidgetCommons.MUTED_TRACK_EDGE_COLOR;
48 } else {
49 newC = TrackWidgetCommons.STANDARD_TRACK_EDGE_COLOR;
50 }
51
52 return newC;
53
54 }
55}
Note: See TracBrowser for help on using the repository browser.