Skip to content

Commit

Permalink
Additional notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
djdiskmachine committed Sep 24, 2024
1 parent b4dc706 commit b086c44
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion sources/Application/Views/BaseClasses/View.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ void View::EnableNotification() {
SetColor(CD_NORMAL);
GUITextProperties props;
DrawString(10, 2, displayNotification_, props);
isDirty_ = true;
} else {
displayNotification_ = "";
}
Expand All @@ -257,5 +256,6 @@ void View::EnableNotification() {
void View::SetNotification(const char *notification) {
notificationTime_ = SDL_GetTicks();
displayNotification_ = (char*) notification;
isDirty_ = true;
}

4 changes: 3 additions & 1 deletion sources/Application/Views/ChainView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ void ChainView::copySelection() {
viewData_->chainRow_=saveRow_ ;
viewData_->chainCol_=saveCol_ ;

isDirty_=true ;
View::SetNotification("copied selection");
} ;

/******************************************************
Expand Down Expand Up @@ -617,6 +617,7 @@ void ChainView::setTextProps(GUITextProperties &props,int row,int col,bool resto
void ChainView::DrawView() {

Clear() ;
View::EnableNotification();

GUITextProperties props ;
GUIPoint pos=GetTitlePosition() ;
Expand Down Expand Up @@ -690,6 +691,7 @@ void ChainView::DrawView() {
if (player->IsRunning()) {
OnPlayerUpdate(PET_UPDATE) ;
} ;

} ;

void ChainView::OnPlayerUpdate(PlayerEventType eventType,unsigned int tick) {
Expand Down
10 changes: 9 additions & 1 deletion sources/Application/Views/PhraseView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ PhraseView::PhraseView(GUIWindow &w,ViewData *viewData):
clipboard_.note_[i]=0xFF ;
clipboard_.instr_[i]=0 ;
} ;
View::EnableNotification();
}

PhraseView::~PhraseView() {
Expand Down Expand Up @@ -508,7 +509,7 @@ void PhraseView::copySelection() {
row_=saveRow_ ;
col_=saveCol_ ;

isDirty_=true ;
View::SetNotification("copied selection");
};

/******************************************************
Expand Down Expand Up @@ -723,6 +724,8 @@ void PhraseView::ProcessButtonMask(unsigned short mask,bool pressed) {
*c=(unsigned char)next ;
lastInstr_=next ;
isDirty_=true ;
} else {
View::SetNotification("No more instruments");
}
}
}else {
Expand All @@ -736,6 +739,8 @@ void PhraseView::ProcessButtonMask(unsigned short mask,bool pressed) {
*c=next ;
isDirty_=true ;
cmdEdit_.SetInt(next) ;
} else {
View::SetNotification("No more tables");
}
}
}
Expand All @@ -747,6 +752,8 @@ void PhraseView::ProcessButtonMask(unsigned short mask,bool pressed) {
*c=next ;
isDirty_=true ;
cmdEdit_.SetInt(next) ;
} else {
View::SetNotification("No more tables");
}
}
} ;
Expand Down Expand Up @@ -999,6 +1006,7 @@ void PhraseView::setTextProps(GUITextProperties & props, int row,int col,bool re
void PhraseView::DrawView() {

Clear() ;
View::EnableNotification();

GUITextProperties props ;
GUIPoint pos=GetTitlePosition() ;
Expand Down
4 changes: 2 additions & 2 deletions sources/Application/Views/SongView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ void SongView::copySelection() {
viewData_->songX_=saveX_ ;
viewData_->songY_=saveY_ ;
viewData_->songOffset_=saveOffset_ ;
isDirty_=true ;
View::SetNotification("copied selection");
}

/******************************************************
Expand Down Expand Up @@ -852,6 +852,7 @@ void SongView::processSelectionButtonMask(unsigned int mask) {
void SongView::DrawView() {

Clear() ;
View::EnableNotification();

GUITextProperties props ;
GUIPoint pos=GetTitlePosition() ;
Expand Down Expand Up @@ -881,7 +882,6 @@ void SongView::DrawView() {

DrawString(pos._x,pos._y,buffer.c_str(),props) ;

View::EnableNotification();
// Compute song grid location

GUIPoint anchor=GetAnchor() ;
Expand Down

0 comments on commit b086c44

Please sign in to comment.