Made backslash mappable. Fixed mistake in previous AddSegment fix so now it correctly compares to the previous segment again. F7/F8 no longer allow negative bpms to match Edit BPM behavior.

This commit is contained in:
Kyzentun
2015-02-16 13:31:21 -07:00
parent d0ee05795f
commit f1229d29cb
3 changed files with 23 additions and 5 deletions
+7 -4
View File
@@ -28,6 +28,7 @@ static void InitNames()
g_mapNamesToString[KEY_COMMA] = "comma";
g_mapNamesToString[KEY_SPACE] = "space";
g_mapNamesToString[KEY_DEL] = "delete";
g_mapNamesToString[KEY_BACKSLASH] = "backslash";
g_mapNamesToString[KEY_BACK] = "backspace";
g_mapNamesToString[KEY_TAB] = "tab";
@@ -145,6 +146,12 @@ RString DeviceButtonToString( DeviceButton key )
{
InitNames();
// Check the name map first to allow making names for keys that are inside
// the ascii range. -Kyz
map<DeviceButton,RString>::const_iterator it = g_mapNamesToString.find( key );
if( it != g_mapNamesToString.end() )
return it->second;
// All printable ASCII except for uppercase alpha characters line up.
if( key >= 33 && key < 127 && !(key >= 'A' && key <= 'Z' ) )
return ssprintf( "%c", key );
@@ -158,10 +165,6 @@ RString DeviceButtonToString( DeviceButton key )
if( key >= MIDI_FIRST && key <= MIDI_LAST )
return ssprintf( "Midi %d", key-MIDI_FIRST );
map<DeviceButton,RString>::const_iterator it = g_mapNamesToString.find( key );
if( it != g_mapNamesToString.end() )
return it->second;
return "unknown";
}
+4 -1
View File
@@ -2367,7 +2367,10 @@ bool ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
}
float fNewBPM = fBPM + fDelta;
GetAppropriateTimingForUpdate().SetBPMAtBeat( GetBeat(), fNewBPM );
if(fNewBPM > 0.0f)
{
GetAppropriateTimingForUpdate().AddSegment(BPMSegment(GetRow(), fNewBPM));
}
(fDelta>0 ? m_soundValueIncrease : m_soundValueDecrease).Play();
SetDirty( true );
}
+12
View File
@@ -423,6 +423,18 @@ void TimingData::AddSegment( const TimingSegment *seg )
return;
}
}
else
{
// if true, this is redundant segment change
if( (*prev) == (*seg) )
{
if( prev != cur )
{
EraseSegment( vSegs, index, cur );
}
return;
}
}
}
else
{