Skip to content

Commit 57f78a4

Browse files
author
mrtnvgr
committed
Consistent view title separators
1 parent 73ab708 commit 57f78a4

5 files changed

Lines changed: 91 additions & 95 deletions

File tree

sources/Application/Views/ChainView.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -811,8 +811,8 @@ void ChainView::OnPlayerUpdate(PlayerEventType eventType, unsigned int tick) {
811811
pos._x += 200;
812812
/*
813813
if (player->Clipped()) {
814-
w_.DrawString("clip",pos,props);
814+
w_.DrawString("clip",pos,props);
815815
} else {
816-
w_.DrawString("----",pos,props);
816+
w_.DrawString("----",pos,props);
817817
}
818818
*/} ;

sources/Application/Views/GrooveView.cpp

Lines changed: 45 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ GrooveView::GrooveView(GUIWindow &w,ViewData *viewData):View(w,viewData) {
88
lastPosition_=0 ;
99
}
1010

11-
GrooveView::~GrooveView() {
12-
}
11+
GrooveView::~GrooveView() {}
1312

1413
void GrooveView::updateCursor(int dir) {
1514
position_+=dir ;
@@ -25,8 +24,8 @@ void GrooveView::updateCursorValue(int val,bool sync) {
2524
if (val<1) val=1 ;
2625
if (val>0xF) val=0xF ;
2726
grooveData[position_]=val ;
28-
isDirty_=true;
29-
} ;
27+
isDirty_ = true;
28+
};
3029

3130
void GrooveView::warpGroove(int dir) {
3231
int current=viewData_->currentGroove_ ;
@@ -53,19 +52,20 @@ void GrooveView::clearCursorValue() {
5352
unsigned char *grooveData=Groove::GetInstance()->GetGrooveData(viewData_->currentGroove_) ;
5453
grooveData[position_]=NO_GROOVE_DATA ;
5554
isDirty_=true ;
56-
}
55+
}
5756

5857
void GrooveView::ProcessButtonMask(unsigned short mask,bool pressed) {
5958

60-
if (!pressed) return ;
61-
62-
Player *player=Player::GetInstance() ;
59+
if (!pressed)
60+
return;
6361

64-
if (mask&EPBM_B) {
65-
if (mask&EPBM_LEFT) {
66-
warpGroove(-1) ;
67-
}
68-
if (mask&EPBM_RIGHT) {
62+
Player *player = Player::GetInstance();
63+
64+
if (mask&EPBM_B) {
65+
if (mask & EPBM_LEFT) {
66+
warpGroove(-1);
67+
}
68+
if (mask&EPBM_RIGHT) {
6969
warpGroove(1) ;
7070
}
7171
if (mask&EPBM_DOWN) {
@@ -79,12 +79,12 @@ void GrooveView::ProcessButtonMask(unsigned short mask,bool pressed) {
7979
} ;
8080
} else {
8181

82-
// A modifier
83-
if (mask&EPBM_A) {
84-
if (mask&EPBM_LEFT) {
85-
updateCursorValue(-1) ;
86-
}
87-
if (mask&EPBM_RIGHT) {
82+
// A modifier
83+
if (mask & EPBM_A) {
84+
if (mask & EPBM_LEFT) {
85+
updateCursorValue(-1);
86+
}
87+
if (mask&EPBM_RIGHT) {
8888
updateCursorValue(1) ;
8989
}
9090
if (mask&EPBM_DOWN) {
@@ -107,20 +107,20 @@ void GrooveView::ProcessButtonMask(unsigned short mask,bool pressed) {
107107
NotifyObservers(&ve) ;
108108
}
109109
if (mask&EPBM_START) {
110-
player->OnStartButton(PM_PHRASE,viewData_->songX_,true,viewData_->chainRow_) ;
111-
}
110+
player->OnStartButton(PM_PHRASE, viewData_->songX_, true,
111+
viewData_->chainRow_);
112+
}
112113

113-
} else {
114+
} else {
114115
// No modifier
115116
if (mask&EPBM_DOWN) updateCursor(1) ;
116117
if (mask&EPBM_UP) updateCursor(-1) ;
117118
if (mask&EPBM_START) {
118119
player->OnStartButton(PM_PHRASE,viewData_->songX_,false,viewData_->chainRow_) ;
119-
}
120-
}
121-
}
122-
123-
}
120+
}
121+
}
122+
}
123+
}
124124
} ;
125125

126126
void GrooveView::DrawView() {
@@ -134,18 +134,17 @@ void GrooveView::DrawView() {
134134

135135
char title[40] ;
136136

137-
SetColor(CD_NORMAL) ;
138-
139-
sprintf(title,"Groove: %2.2x",viewData_->currentGroove_) ;
137+
SetColor(CD_NORMAL);
138+
sprintf(title,"Groove %2.2x", viewData_->currentGroove_) ;
140139
DrawString(pos._x,pos._y,title,props) ;
141140

142141
// Compute song grid location
143142

144-
GUIPoint anchor=GetAnchor() ;
145-
146-
// Display row numbers
143+
GUIPoint anchor = GetAnchor();
147144

148-
char buffer[6] ;
145+
// Display row numbers
146+
147+
char buffer[6] ;
149148
pos=anchor ;
150149
pos._x-=3 ;
151150
for (int j=0;j<16;j++) {
@@ -168,12 +167,12 @@ void GrooveView::DrawView() {
168167
hex2char(grooveData[j],buffer) ;
169168
buffer[3]=0 ;
170169
} else {
171-
strcpy(buffer,"--") ;
172-
} ;
173-
props.invert_=(j==position_) ;
174-
DrawString(pos._x,pos._y,buffer,props) ;
175-
pos._y++ ;
176-
}
170+
strcpy(buffer, "--");
171+
} ;
172+
props.invert_ = (j == position_);
173+
DrawString(pos._x,pos._y,buffer,props) ;
174+
pos._y++;
175+
}
177176

178177
drawMap() ;
179178
drawNotes() ;
@@ -186,12 +185,12 @@ void GrooveView::OnPlayerUpdate(PlayerEventType ,unsigned int tick) {
186185
GUIPoint pos ;
187186

188187
pos._x=anchor._x-1 ;
189-
pos._y=anchor._y+lastPosition_ ;
190-
DrawString(pos._x,pos._y," ",props) ;
191-
192-
Groove *gr=Groove::GetInstance() ;
193-
// Get current channel
194-
int channel=viewData_->songX_ ;
188+
pos._y = anchor._y + lastPosition_;
189+
DrawString(pos._x,pos._y," ",props) ;
190+
191+
Groove *gr=Groove::GetInstance() ;
192+
// Get current channel
193+
int channel=viewData_->songX_ ;
195194

196195
int groove ;
197196
int groovepos ;

sources/Application/Views/InstrumentView.cpp

Lines changed: 33 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ void InstrumentView::onInstrumentChange() {
4646
T_SimpleList<UIField>::Empty() ;
4747

4848
InstrumentType it=getInstrumentType() ;
49-
50-
switch (it) {
49+
50+
switch (it) {
5151
case IT_MIDI:
5252
fillMidiParameters() ;
5353
break ;
@@ -77,7 +77,7 @@ void InstrumentView::fillSampleParameters() {
7777
I_Instrument *instr=bank->GetInstrument(i) ;
7878
SampleInstrument *instrument=(SampleInstrument *)instr ;
7979
GUIPoint position=GetAnchor() ;
80-
80+
8181
// position._y+=View::fieldSpaceHeight_;
8282
Variable *v=instrument->FindVariable(SIP_SAMPLE) ;
8383
SamplePool *sp=SamplePool::GetInstance() ;
@@ -90,11 +90,11 @@ void InstrumentView::fillSampleParameters() {
9090
f1 = new UIIntVarField(position, *v, "%s", 0, 3, 1, 2);
9191
T_SimpleList<UIField>::Insert(f1) ;
9292

93-
position._x += 8;
93+
position._x += 7;
9494
v = instrument->FindVariable(SIP_IR_WET);
9595
f1 = new UIIntVarField(position, *v, "wet:%d%%", 0, 100, 1, 10);
9696
T_SimpleList<UIField>::Insert(f1);
97-
position._x += 8;
97+
position._x += 9;
9898

9999
v = instrument->FindVariable(SIP_IR_PAD);
100100
f1 = new UIIntVarField(position, *v, "pad:%dms", 0, 5000, 5, 100);
@@ -105,8 +105,8 @@ void InstrumentView::fillSampleParameters() {
105105
v=instrument->FindVariable(SIP_VOLUME) ;
106106
f1=new UIIntVarField(position,*v,"volume: %d [%2.2X]",0,255,1,10) ;
107107
T_SimpleList<UIField>::Insert(f1) ;
108-
109-
position._y+=1 ;
108+
109+
position._y+=1 ;
110110
v=instrument->FindVariable(SIP_PAN) ;
111111
f1=new UIIntVarField(position,*v,"pan: %2.2X",0,0xFE,1,0x10) ;
112112
T_SimpleList<UIField>::Insert(f1) ;
@@ -188,8 +188,8 @@ void InstrumentView::fillSampleParameters() {
188188
v=instrument->FindVariable(SIP_INTERPOLATION) ;
189189
f1=new UIIntVarField(position,*v,"interpolation: %s",0,1,1,1) ;
190190
T_SimpleList<UIField>::Insert(f1) ;
191-
192-
position._y+=1 ;
191+
192+
position._y+=1 ;
193193
v=instrument->FindVariable(SIP_LOOPMODE) ;
194194
f1=new UIIntVarField(position,*v,"loop mode: %s",0,SILM_LAST-1,1,1) ;
195195
T_SimpleList<UIField>::Insert(f1) ;
@@ -347,12 +347,12 @@ void InstrumentView::ProcessButtonMask(unsigned short mask,bool pressed) {
347347
}
348348

349349
FieldView::ProcessButtonMask(mask) ;
350-
351-
Player *player=Player::GetInstance() ;
350+
351+
Player *player=Player::GetInstance() ;
352352
// B Modifier
353353

354-
if (mask&EPBM_B) {
355-
if (mask&EPBM_LEFT) warpToNext(-1) ;
354+
if (mask & EPBM_B) {
355+
if (mask&EPBM_LEFT) warpToNext(-1) ;
356356
if (mask&EPBM_RIGHT) warpToNext(+1);
357357
if (mask&EPBM_DOWN) warpToNext(-16) ;
358358
if (mask&EPBM_UP) warpToNext(+16);
@@ -382,21 +382,21 @@ void InstrumentView::ProcessButtonMask(unsigned short mask,bool pressed) {
382382
if (mask&EPBM_L) {
383383
viewMode_=VM_CLONE ;
384384
} ;
385-
} else {
385+
} else {
386386

387-
// A modifier
387+
// A modifier
388388

389-
if (mask==EPBM_A) {
390-
FourCC varID=((UIIntVarField *)GetFocus())->GetVariableID() ;
389+
if (mask == EPBM_A) {
390+
FourCC varID=((UIIntVarField *)GetFocus())->GetVariableID() ;
391391
if ((varID==SIP_TABLE)||(varID==MIP_TABLE)||(varID==SIP_SAMPLE)) {
392392
viewMode_=VM_NEW ;
393393
} ;
394-
} else {
394+
} else {
395395

396-
// R Modifier
396+
// R Modifier
397397

398-
if (mask&EPBM_R) {
399-
if (mask&EPBM_LEFT) {
398+
if (mask & EPBM_R) {
399+
if (mask&EPBM_LEFT) {
400400
ViewType vt=VT_PHRASE;
401401
ViewEvent ve(VET_SWITCH_VIEW,&vt) ;
402402
SetChanged();
@@ -436,18 +436,17 @@ void InstrumentView::ProcessButtonMask(unsigned short mask,bool pressed) {
436436
if (mask&EPBM_START) {
437437
player->OnStartButton(PM_PHRASE,viewData_->songX_,true,viewData_->chainRow_) ;
438438
}
439-
} else {
439+
} else {
440440
// No modifier
441441
if (mask&EPBM_START) {
442442
player->OnStartButton(PM_PHRASE,viewData_->songX_,false,viewData_->chainRow_) ;
443443
}
444-
}
445-
}
446-
447-
}
444+
}
445+
}
446+
}
448447

449-
UIIntVarField *field=(UIIntVarField *)GetFocus() ;
450-
if (field) {
448+
UIIntVarField *field = (UIIntVarField *)GetFocus();
449+
if (field) {
451450
lastFocusID_=field->GetVariableID() ;
452451
}
453452

@@ -465,19 +464,16 @@ void InstrumentView::DrawView() {
465464

466465
char title[20];
467466
SetColor(CD_NORMAL) ;
468-
sprintf(title,"Instrument %2.2X",viewData_->currentInstrument_) ;
469-
DrawString(pos._x,pos._y,title,props) ;
467+
sprintf(title, "Instrument %2.2X", viewData_->currentInstrument_);
468+
DrawString(pos._x, pos._y, title, props);
470469

471-
// Draw fields
470+
// Draw fields
472471

473-
FieldView::Redraw() ;
474-
drawMap() ;
472+
FieldView::Redraw();
473+
drawMap() ;
475474
} ;
476475

477-
void InstrumentView::OnFocus() {
478-
onInstrumentChange() ;
479-
}
480-
476+
void InstrumentView::OnFocus() { onInstrumentChange(); }
481477

482478
void InstrumentView::Update(Observable &o,I_ObservableData *d) {
483479
onInstrumentChange() ;

sources/Application/Views/ProjectView.cpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ ProjectView::ProjectView(GUIWindow &w,ViewData *data):FieldView(w,data) {
100100
project_=data->project_ ;
101101

102102
GUIPoint position=GetAnchor() ;
103-
104-
Variable *v=project_->FindVariable(VAR_TEMPO) ;
103+
104+
Variable *v=project_->FindVariable(VAR_TEMPO) ;
105105
UITempoField *f=new UITempoField(ACTION_TEMPO_CHANGED,position,*v,"tempo: %d [%2.2x] ",60,400,1,10) ;
106106
T_SimpleList<UIField>::Insert(f) ;
107107
f->AddObserver(*this) ;
@@ -128,8 +128,8 @@ ProjectView::ProjectView(GUIWindow &w,ViewData *data):FieldView(w,data) {
128128
position._y+=2 ;
129129
UIIntVarField *f2=new UIIntVarField(position,*v,"transpose: %3.2d",-48,48,0x1,0xC) ;
130130
T_SimpleList<UIField>::Insert(f2) ;
131-
132-
v = project_->FindVariable(VAR_SCALE);
131+
132+
v = project_->FindVariable(VAR_SCALE);
133133
// if scale name is not found, set the default chromatic scale
134134
if (v->GetInt() < 0) {
135135
v->SetInt(0);
@@ -205,19 +205,20 @@ void ProjectView::ProcessButtonMask(unsigned short mask,bool pressed) {
205205
} ;
206206

207207
void ProjectView::DrawView() {
208-
209-
Clear() ;
208+
209+
Clear() ;
210210

211211
GUITextProperties props ;
212212
GUIPoint pos=GetTitlePosition() ;
213213

214214
// Draw title
215215

216216
char projectString[80] ;
217-
sprintf(projectString,"Project - Build %s.%s.%s",PROJECT_NUMBER,PROJECT_RELEASE,BUILD_COUNT) ;
217+
sprintf(projectString, "Project (Build %s.%s.%s)", PROJECT_NUMBER,
218+
PROJECT_RELEASE, BUILD_COUNT);
218219

219-
SetColor(CD_NORMAL) ;
220-
DrawString(pos._x,pos._y,projectString,props) ;
220+
SetColor(CD_NORMAL);
221+
DrawString(pos._x,pos._y,projectString,props) ;
221222

222223
FieldView::Redraw() ;
223224
drawMap() ;

sources/Application/Views/SongView.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,7 @@ void SongView::DrawView() {
911911
std::ostringstream os;
912912

913913
os << ((player->GetSequencerMode() == SM_SONG) ? "Song" : "Live");
914-
os << " - ";
914+
os << ": ";
915915
os << songname_;
916916
std::string buffer(os.str());
917917

0 commit comments

Comments
 (0)