diff --git a/Docs/Changelog_language.txt b/Docs/Changelog_language.txt index 97c437a8f0..fb622fa8a6 100644 --- a/Docs/Changelog_language.txt +++ b/Docs/Changelog_language.txt @@ -5,13 +5,45 @@ StepMania 5.0.6. This is to inform translators of strings that need to be translated from English to other languages. ________________________________________________________________________________ -Strings are listed by the section of the language file they are in. Example: +Strings are listed by the section of the language file they are in. +One string is listed per line, to minimize confusion. +Example: -* [ScreenDebugOverlay] Mute actions, Mute actions on, Mute actions off +* [ScreenDebugOverlay] Mute actions + Mute actions on + Mute actions off This means that three strings were added to the "ScreenDebugOverlay" section, "Mute actions", "Mute actions on", and "Mute actions off". + + +2015/04/04 (Day not found) +---------- +* [OptionNames] 1m + 2m + 2nd + 4m +* [OptionTitles] All timing + BPM changes + Combo segments + Delays + Labels + Paste timing from clipboard + Scroll segments + Shift timing in region down + Shift timing in region up + Speed segments + Stops + Tickcount + Time Signatures + Warps +* [ScreenTextEntry] "%s" is an invalid integer value. + +================================================================================ +StepMania 5.0.7 | 20150401 +-------------------------------------------------------------------------------- + 2015/03/27 ---------- * [OptionExplanations] AllowSongDeletion @@ -20,8 +52,10 @@ This means that three strings were added to the "ScreenDebugOverlay" section, 2015/04/08 ---------- -* [OptionExplanations] EditClearPromptThreshold, HarshHotLifePenalty -* [OptionTitles] EditClearPromptThreshold, HarshHotLifePenalty +* [OptionExplanations] EditClearPromptThreshold + HarshHotLifePenalty +* [OptionTitles] EditClearPromptThreshold + HarshHotLifePenalty * [ScreenEdit] Are you sure you want to clear %d notes? 2015/04/02 @@ -38,7 +72,9 @@ This means that three strings were added to the "ScreenDebugOverlay" section, 2015/02/27 ---------- -* [ScreenDebugOverlay] Mute actions, Mute actions on, Mute actions off +* [ScreenDebugOverlay] Mute actions + Mute actions on + Mute actions off 2015/02/22 ---------- diff --git a/Themes/_fallback/Languages/en.ini b/Themes/_fallback/Languages/en.ini index a565c911e7..091d55a73c 100644 --- a/Themes/_fallback/Languages/en.ini +++ b/Themes/_fallback/Languages/en.ini @@ -647,11 +647,14 @@ x2.5=2.5x 16bit=16bit 16th=16th 192nd=192nd +1m=1m 2=2 2 Players for 1 Credit=2 Players for 1 Credit 2 Times=2 Times 2.0x=2.0x 24th=24th +2m=2m +2nd=2nd 3=3 3 Times=3 Times 32bit=32bit @@ -660,6 +663,7 @@ x2.5=2.5x 4 Times=4 Times 48th=48th 4th=4th +4m=4m 5=5 5 Times=5 Times 6=6 @@ -934,6 +938,7 @@ Add/Edit Background Change=Add/Edit Background Change Add Attack=Add Attack Add Mod=Add Mod Air=Air +All timing=All timing AllowExtraStage=Allow Extra Stage AllowSongDeletion=Allow Song Deletion AllowW1=Fantastic Timing @@ -962,6 +967,7 @@ BatLives=Bat Lives Base Difficulty=Base Difficulty Beat 0 Offset=Beat 0 Offset Bookkeeping=Bookkeeping +BPM changes=BPM changes Calibrate Machine Sync=Calibrate Audio Sync CPUSkill=CPU Skill CelShadeModels=Cel-shaded Models @@ -981,6 +987,7 @@ CoinMode=Coin Mode CoinModeNoHome=Coin Mode CoinsPerCredit=Coins Per Credit ComboContinuesBetweenSongs=Carry Combo +Combo segments=Combo segments Connection=Connection Convert pause to beats=Convert stop to beats Convert delay to beats=Convert delay to beats @@ -991,6 +998,7 @@ Convert selection to warp=Convert selection to Warp Segment Convert selection to fake=Convert selection to Fake Segment Copy=Copy Copy timing data=Copy timing data +Copy timing in region=Copy timing in region Copy Partial Timing=Copy Selected Timing Data CourseSortOrder=Course Sort Create New=Create New @@ -1004,6 +1012,7 @@ DefaultFailTypeNoOff=Default Fail Type DefaultNoteSkin=Default NoteSkin DelayedBack=Back Delayed DelayedTextureDelete=Keep Textures In Memory +Delays=Delays Delete=Delete Delete beat and shift up=Delete beat and shift up Description=Description @@ -1100,6 +1109,7 @@ Invalid=Invalid Invert notes' player=Invert player notes (routine only) Jumps=Jumps Key Joy Mappings=Config Key/Joy Mappings +Labels=Labels Language=Language Last second hint=Last second hint Layer=Layer @@ -1141,6 +1151,7 @@ OsMountPlayer2=OS Mount Player2 Paste at begin marker=Paste at begin marker Paste at current beat=Paste at current beat Paste timing data=Paste timing data +Paste timing from clipboard=Paste timing from clipboard Paste Partial Timing at current beat=Paste Partial Timing at current beat Persp=Perspective Play current beat to end=Play current beat to end @@ -1192,6 +1203,7 @@ Scoreboard=Scoreboard ScoringType=Scoring Type ScreenFilter=Screen Filter Scroll=Scroll +Scroll segments=Scroll segments Secret=Secret Secs Remaining=Seconds Remaining Server=Server @@ -1205,6 +1217,8 @@ Set selection start=Set selection start Set selection end=Set selection end Shift all timing changes down=Shift all timing changes down Shift all timing changes up=Shift all timing changes up +Shift timing in region down=Shift timing in region down +Shift timing in region up=Shift timing in region up ShowBanners=Show Banners ShowBeginnerHelper=Beginner Helper ShowCaution=Caution @@ -1218,8 +1232,10 @@ ShowSongOptions=Show Song Options ShowStats=Show Stats SmoothLines=SmoothLines SoundEffect=Sound Effect +Speed segments=Speed segments Starting Time=Starting Time StepMania Credits=StepMania Credits +Stops=Stops Center1Player=Center 1 Player Song=Song Song Group=Song Group @@ -1247,7 +1263,9 @@ Test Lights=Test Lights TextureColorDepth=Texture Color Theme=Theme ThreeKeyNavigation=Menu Navigation +Tickcount=Tickcount TimingWindowScale=Judge Difficulty +Time Signatures=Time Signatures Transform=Transform Transfer Edits to USB=Transfer Edits to USB Transfer Edits from USB=Transfer Edits from USB @@ -1259,6 +1277,7 @@ View steps data=View Steps Data VisualDelaySeconds=Visual Delay Voltage=Voltage Vsync=Wait For Vsync +Warps=Warps WideScreen16_9=Widescreen WideScreen16_10=Widescreen Windowed=Display Mode @@ -1975,6 +1994,7 @@ Done=Done HeaderText= Space=Space "%s" is an invalid floating point value.="%s" is an invalid floating point value. +"%s" is an invalid integer value.="%s" is an invalid integer value. AnswerCaret=_ AnswerBlank= diff --git a/Themes/_fallback/metrics.ini b/Themes/_fallback/metrics.ini index 575c0b4d0c..7e39fe1231 100644 --- a/Themes/_fallback/metrics.ini +++ b/Themes/_fallback/metrics.ini @@ -4227,6 +4227,9 @@ Fallback="ScreenMiniMenu" [ScreenMiniMenuTimingDataInformation] Fallback="ScreenMiniMenu" +[ScreenMiniMenuTimingDataChangeInformation] +Fallback="ScreenMiniMenu" + [ScreenMiniMenuBackgroundChange] Fallback="ScreenMiniMenu" diff --git a/src/ScreenEdit.cpp b/src/ScreenEdit.cpp index 0b65fe747e..faa3f9fb70 100644 --- a/src/ScreenEdit.cpp +++ b/src/ScreenEdit.cpp @@ -94,6 +94,7 @@ AutoScreenMessage( SM_DoRevertToLastSave ); AutoScreenMessage( SM_DoRevertFromDisk ); AutoScreenMessage( SM_ConfirmClearArea ); AutoScreenMessage( SM_BackFromTimingDataInformation ); +AutoScreenMessage(SM_BackFromTimingDataChangeInformation); AutoScreenMessage( SM_BackFromDifficultyMeterChange ); AutoScreenMessage( SM_BackFromBeat0Change ); AutoScreenMessage( SM_BackFromBPMChange ); @@ -699,6 +700,63 @@ const MapEditButtonToMenuButton *ScreenEdit::GetCurrentMenuButtonMap() const } } +enum RowCountChoice +{ + RCC_4M, + RCC_2M, + RCC_1M, + RCC_2ND, + RCC_4TH, + RCC_8TH, + RCC_12TH, + RCC_16TH, + RCC_24TH, + RCC_32ND, + RCC_48TH, + RCC_64TH, + RCC_192ND, +}; + +#define RCC_CHOICES RCC_4TH, "4m", "2m", "1m", "2nd", "4th","8th","12th","16th","24th","32nd","48th","64th","192nd" + +int GetRowsFromAnswers(int choice, const vector& answers); +int GetRowsFromAnswers(int choice, const vector& answers) +{ + if(answers.empty()) + { + return 192 / 8; + } + switch(answers[choice]) + { + case RCC_4M: + return 192 * 4; + case RCC_2M: + return 192 * 2; + case RCC_1M: + return 192; + case RCC_2ND: + return 192 / 2; + case RCC_4TH: + default: + return 192 / 4; + case RCC_8TH: + return 192 / 8; + case RCC_12TH: + return 192 / 12; + case RCC_16TH: + return 192 / 16; + case RCC_24TH: + return 192 / 24; + case RCC_32ND: + return 192 / 32; + case RCC_48TH: + return 192 / 48; + case RCC_64TH: + return 3; + case RCC_192ND: + return 1; + } +} static MenuDef g_EditHelp( "ScreenMiniMenuEditHelp" @@ -851,16 +909,16 @@ static MenuDef g_AreaMenu( true, EditMode_Practice, true, true, 0, NULL ), MenuRowDef(ScreenEdit::insert_and_shift, "Insert beat and shift down", - true, EditMode_Practice, true, true, 0, "4th","8th","12th","16th","24th","32nd","48th","64th","192nd" ), + true, EditMode_Practice, true, true, RCC_CHOICES ), MenuRowDef(ScreenEdit::delete_and_shift, "Delete beat and shift up", - true, EditMode_Practice, true, true, 0, "4th","8th","12th","16th","24th","32nd","48th","64th","192nd" ), + true, EditMode_Practice, true, true, RCC_CHOICES ), MenuRowDef(ScreenEdit::shift_pauses_forward, "Shift all timing changes down", - true, EditMode_Full, true, true, 0, "4th","8th","12th","16th","24th","32nd","48th","64th","192nd" ), + true, EditMode_Full, true, true, RCC_CHOICES ), MenuRowDef(ScreenEdit::shift_pauses_backward, "Shift all timing changes up", - true, EditMode_Full, true, true, 0, "4th","8th","12th","16th","24th","32nd","48th","64th","192nd" ), + true, EditMode_Full, true, true, RCC_CHOICES ), MenuRowDef(ScreenEdit::convert_pause_to_beat, "Convert pause to beats", true, @@ -1033,6 +1091,18 @@ static MenuDef g_TimingDataInformation( MenuRowDef(ScreenEdit::fake, "Edit fake", true, EditMode_Full, true, true, 0, NULL ), + MenuRowDef(ScreenEdit::shift_timing_in_region_down, + "Shift timing in region down", + true, EditMode_Full, true, true, RCC_CHOICES), + MenuRowDef(ScreenEdit::shift_timing_in_region_up, + "Shift timing in region up", + true, EditMode_Full, true, true, RCC_CHOICES), + MenuRowDef(ScreenEdit::copy_timing_in_region, + "Copy timing in region", + true, EditMode_Full, true, true, 0, NULL), + MenuRowDef(ScreenEdit::paste_timing_from_clip, + "Paste timing from clipboard", + true, EditMode_Full, true, true, 0, NULL), MenuRowDef(ScreenEdit::copy_full_timing, "Copy timing data", true, EditMode_Full, true, true, 0, NULL ), @@ -1044,6 +1114,47 @@ static MenuDef g_TimingDataInformation( true, EditMode_Full, true, true, 0, NULL ) ); +static MenuDef g_TimingDataChangeInformation( + "ScreenMiniMenuTimingDataChangeInformation", + MenuRowDef(ScreenEdit::timing_all, + "All timing", + true, EditMode_Full, true, true, 0, NULL), + MenuRowDef(ScreenEdit::timing_bpm, + "BPM changes", + true, EditMode_Full, true, true, 0, NULL), + MenuRowDef(ScreenEdit::timing_stop, + "Stops", + true, EditMode_Full, true, true, 0, NULL), + MenuRowDef(ScreenEdit::timing_delay, + "Delays", + true, EditMode_Full, true, true, 0, NULL), + // Time signatures disabled because they don't fully work. -Kyz + // MenuRowDef(ScreenEdit::timing_time_sig, + // "Time Signatures", + // true, EditMode_Full, true, true, 0, NULL), + MenuRowDef(ScreenEdit::timing_warp, + "Warps", + true, EditMode_Full, true, true, 0, NULL), + MenuRowDef(ScreenEdit::timing_label, + "Labels", + true, EditMode_Full, true, true, 0, NULL), + MenuRowDef(ScreenEdit::timing_tickcount, + "Tickcount", + true, EditMode_Full, true, true, 0, NULL), + MenuRowDef(ScreenEdit::timing_combo, + "Combo segments", + true, EditMode_Full, true, true, 0, NULL), + MenuRowDef(ScreenEdit::timing_speed, + "Speed segments", + true, EditMode_Full, true, true, 0, NULL), + MenuRowDef(ScreenEdit::timing_scroll, + "Scroll segments", + true, EditMode_Full, true, true, 0, NULL), + MenuRowDef(ScreenEdit::timing_fake, + "Fakes", + true, EditMode_Full, true, true, 0, NULL) +); + // XXX: What are these enums used for? enum { @@ -3541,6 +3652,10 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM ) { HandleTimingDataInformationChoice( (TimingDataInformationChoice)ScreenMiniMenu::s_iLastRowCode, ScreenMiniMenu::s_viLastAnswers ); } + else if(SM == SM_BackFromTimingDataChangeInformation) + { + HandleTimingDataChangeChoice((TimingDataChangeChoice)ScreenMiniMenu::s_iLastRowCode, ScreenMiniMenu::s_viLastAnswers); + } else if( SM == SM_BackFromDifficultyMeterChange ) { int i = StringToInt( ScreenTextEntry::s_sLastAnswer ); @@ -4628,6 +4743,12 @@ void ScreenEdit::DisplayTimingMenu() EditMiniMenu( &g_TimingDataInformation, SM_BackFromTimingDataInformation ); } +void ScreenEdit::DisplayTimingChangeMenu() +{ + int row= GetRow(); + EditMiniMenu(&g_TimingDataChangeInformation, SM_BackFromTimingDataChangeInformation); +} + // End helper functions static LocalizedString REVERT_LAST_SAVE ( "ScreenEdit", "Do you want to revert to your last save?" ); @@ -5355,23 +5476,19 @@ void ScreenEdit::HandleAreaMenuChoice( AreaMenuChoice c, const vector &iAns case insert_and_shift: NoteDataUtil::InsertRows( m_NoteDataEdit, GetRow(), - iAnswers.size() > 0 ? - NoteTypeToRow((NoteType)iAnswers[c]) : 48); + GetRowsFromAnswers(c, iAnswers)); break; case delete_and_shift: NoteDataUtil::DeleteRows( m_NoteDataEdit, GetRow(), - iAnswers.size() > 0 ? - NoteTypeToRow((NoteType)iAnswers[c]) : 48); + GetRowsFromAnswers(c, iAnswers)); break; case shift_pauses_forward: GetAppropriateTimingForUpdate().InsertRows( GetRow(), - iAnswers.size() > 0 ? - NoteTypeToRow((NoteType)iAnswers[c]) : 48); + GetRowsFromAnswers(c, iAnswers)); break; case shift_pauses_backward: GetAppropriateTimingForUpdate().DeleteRows( GetRow(), - iAnswers.size() > 0 ? - NoteTypeToRow((NoteType)iAnswers[c]) : 48); + GetRowsFromAnswers(c, iAnswers)); break; case convert_pause_to_beat: @@ -5501,7 +5618,7 @@ void ScreenEdit::HandleStepsInformationChoice( StepsInformationChoice c, const v ENTER_NEW_METER, ssprintf("%d", m_pSteps->GetMeter()), 4, - NULL, + ScreenTextEntry::IntValidate, ChangeStepMeter, NULL); break; @@ -5747,6 +5864,23 @@ void ScreenEdit::HandleTimingDataInformationChoice( TimingDataInformationChoice ); break; } + case shift_timing_in_region_down: + m_timing_is_being_copied= false; + m_timing_rows_being_shitted= GetRowsFromAnswers(c, iAnswers); + DisplayTimingChangeMenu(); + break; + case shift_timing_in_region_up: + m_timing_is_being_copied= false; + m_timing_rows_being_shitted= -GetRowsFromAnswers(c, iAnswers); + DisplayTimingChangeMenu(); + break; + case copy_timing_in_region: + m_timing_is_being_copied= true; + DisplayTimingChangeMenu(); + break; + case paste_timing_from_clip: + clipboardFullTiming.CopyRange(0, MAX_NOTE_ROW, TimingSegmentType_Invalid, GetRow(), GetAppropriateTimingForUpdate()); + break; case copy_full_timing: { clipboardFullTiming = GetAppropriateTiming(); @@ -5772,6 +5906,71 @@ void ScreenEdit::HandleTimingDataInformationChoice( TimingDataInformationChoice } } +void ScreenEdit::HandleTimingDataChangeChoice(TimingDataChangeChoice choice, + const vector& answers) +{ + TimingSegmentType change_type= TimingSegmentType_Invalid; + switch(choice) + { + case timing_all: + change_type= TimingSegmentType_Invalid; + break; + case timing_bpm: + change_type= SEGMENT_BPM; + break; + case timing_stop: + change_type= SEGMENT_STOP; + break; + case timing_delay: + change_type= SEGMENT_DELAY; + break; + case timing_time_sig: + change_type= SEGMENT_TIME_SIG; + break; + case timing_warp: + change_type= SEGMENT_WARP; + break; + case timing_label: + change_type= SEGMENT_LABEL; + break; + case timing_tickcount: + change_type= SEGMENT_TICKCOUNT; + break; + case timing_combo: + change_type= SEGMENT_COMBO; + break; + case timing_speed: + change_type= SEGMENT_SPEED; + break; + case timing_scroll: + change_type= SEGMENT_SCROLL; + break; + case timing_fake: + change_type= SEGMENT_FAKE; + break; + default: break; + } + int begin= m_NoteFieldEdit.m_iBeginMarker; + int end= m_NoteFieldEdit.m_iEndMarker; + if(begin < 0) + { + begin= GetRow(); + } + if(end < 0) + { + end= MAX_NOTE_ROW; + } + if(m_timing_is_being_copied) + { + clipboardFullTiming.Clear(); + GetAppropriateTiming().CopyRange(begin, end, change_type, 0, clipboardFullTiming); + } + else + { + GetAppropriateTimingForUpdate().ShiftRange(begin, end, change_type, m_timing_rows_being_shitted); + } +} + void ScreenEdit::HandleBGChangeChoice( BGChangeChoice c, const vector &iAnswers ) { BackgroundChange newChange; diff --git a/src/ScreenEdit.h b/src/ScreenEdit.h index 1946adfdca..590014a0b1 100644 --- a/src/ScreenEdit.h +++ b/src/ScreenEdit.h @@ -268,6 +268,10 @@ protected: /** @brief Display the TimingData menu for editing song and step timing. */ void DisplayTimingMenu(); + bool m_timing_is_being_copied; // Instead of being shifted. + int m_timing_rows_being_shitted; // How far the timing is being shitted. + void DisplayTimingChangeMenu(); + EditState m_EditState; Song* m_pSong; @@ -603,15 +607,37 @@ public: speed_mode, scroll, fake, + shift_timing_in_region_down, + shift_timing_in_region_up, + copy_timing_in_region, + paste_timing_from_clip, copy_full_timing, paste_full_timing, erase_step_timing, NUM_TIMING_DATA_INFORMATION_CHOICES }; - - void HandleTimingDataInformationChoice (TimingDataInformationChoice c, + void HandleTimingDataInformationChoice (TimingDataInformationChoice c, const vector &iAnswers ); + enum TimingDataChangeChoice + { + timing_all, + timing_bpm, + timing_stop, + timing_delay, + timing_time_sig, + timing_warp, + timing_label, + timing_tickcount, + timing_combo, + timing_speed, + timing_scroll, + timing_fake, + NUM_TimingDataChangeChoices + }; + void HandleTimingDataChangeChoice(TimingDataChangeChoice choice, + const vector& answers); + enum BGChangeChoice { layer, diff --git a/src/ScreenTextEntry.cpp b/src/ScreenTextEntry.cpp index f8d37b687b..f053c940e0 100644 --- a/src/ScreenTextEntry.cpp +++ b/src/ScreenTextEntry.cpp @@ -108,6 +108,16 @@ bool ScreenTextEntry::FloatValidate( const RString &sAnswer, RString &sErrorOut return false; } +static LocalizedString INVALID_INT( "ScreenTextEntry", "\"%s\" is an invalid integer value." ); +bool ScreenTextEntry::IntValidate( const RString &sAnswer, RString &sErrorOut ) +{ + int f; + if(sAnswer >> f) + return true; + sErrorOut = ssprintf( INVALID_INT.GetValue(), sAnswer.c_str() ); + return false; +} + bool ScreenTextEntry::s_bCancelledLast = false; /* Handle UTF-8. Right now, we need to at least be able to backspace a whole diff --git a/src/ScreenTextEntry.h b/src/ScreenTextEntry.h index ee78688dff..7c15eef8b4 100644 --- a/src/ScreenTextEntry.h +++ b/src/ScreenTextEntry.h @@ -97,6 +97,7 @@ public: void LoadFromTextEntrySettings( const TextEntrySettings &settings ); static bool FloatValidate( const RString &sAnswer, RString &sErrorOut ); + static bool IntValidate( const RString &sAnswer, RString &sErrorOut ); virtual void Init(); virtual void BeginScreen(); diff --git a/src/TimingData.cpp b/src/TimingData.cpp index b0becfecec..4fba921f08 100644 --- a/src/TimingData.cpp +++ b/src/TimingData.cpp @@ -8,6 +8,9 @@ #include "Foreach.h" #include +static void EraseSegment(vector &vSegs, int index, TimingSegment *cur); +static const int INVALID_INDEX = -1; + TimingSegment* GetSegmentAtRow( int iNoteRow, TimingSegmentType tst ); TimingData::TimingData(float fOffset) : m_fBeat0OffsetInSeconds(fOffset) @@ -189,6 +192,72 @@ void TimingData::CopyRange(int start_row, int end_row, } } +void TimingData::ShiftRange(int start_row, int end_row, + TimingSegmentType shift_type, int shift_amount) +{ + FOREACH_TimingSegmentType(seg_type) + { + if(seg_type == shift_type || shift_type == TimingSegmentType_Invalid) + { + vector& segs= GetTimingSegments(seg_type); + int first_row= min(start_row, start_row + shift_amount); + int last_row= max(end_row, end_row + shift_amount); + int first_affected= GetSegmentIndexAtRow(seg_type, first_row); + int last_affected= GetSegmentIndexAtRow(seg_type, last_row); + if(first_affected == INVALID_INDEX) + { + continue; + } + // Prance through the affected area twice. The first time, changing + // the rows of the segments, the second time removing segments that + // have been run over by a segment being moved. Attempts to combine + // both operations into a single loop were error prone. -Kyz + for(size_t i= first_affected; i <= last_affected && i < segs.size(); ++i) + { + int seg_row= segs[i]->GetRow(); + if(seg_row > 0 && seg_row >= start_row && seg_row <= end_row) + { + int dest_row= max(seg_row + shift_amount, 0); + segs[i]->SetRow(dest_row); + } + } +#define ERASE_SEG(s) if(segs.size() > 1) { EraseSegment(segs, s, segs[s]); --i; --last_affected; erased= true; } + for(size_t i= first_affected; i <= last_affected && i < segs.size(); ++i) + { + bool erased= false; + int seg_row= segs[i]->GetRow(); + if(i < segs.size() - 1) + { + int next_row= segs[i+1]->GetRow(); + // This is a loop so that it will go back through and remove all + // segments that were run over. -Kyz + while(seg_row >= next_row && seg_row < start_row) + { + ERASE_SEG(i); + if(i < segs.size()) + { + seg_row= segs[i]->GetRow(); + } + else + { + seg_row= -1; + } + } + } + if(!erased && i > 0) + { + int prev_row= segs[i-1]->GetRow(); + if(prev_row >= seg_row) + { + ERASE_SEG(i); + } + } + } +#undef ERASE_SEG + } + } +} + void TimingData::GetActualBPM( float &fMinBPMOut, float &fMaxBPMOut, float highest ) const { fMinBPMOut = FLT_MAX; @@ -232,8 +301,6 @@ float TimingData::GetPreviousSegmentBeatAtRow(TimingSegmentType tst, int row) co return (backup > -1) ? backup : NoteRowToBeat(row); } -static const int INVALID_INDEX = -1; - int TimingData::GetSegmentIndexAtRow(TimingSegmentType tst, int iRow ) const { const vector &vSegs = GetTimingSegments(tst); diff --git a/src/TimingData.h b/src/TimingData.h index fcad1f125b..3ef0b332f3 100644 --- a/src/TimingData.h +++ b/src/TimingData.h @@ -150,6 +150,7 @@ public: bool empty() const; void CopyRange(int start_row, int end_row, TimingSegmentType copy_type, int dest_row, TimingData& dest) const; + void ShiftRange(int start_row, int end_row, TimingSegmentType shift_type, int shift_amount); /** * @brief Gets the actual BPM of the song, * while respecting a limit.