|
From: <sag...@us...> - 2014-12-24 15:16:08
|
Revision: 4679
http://sourceforge.net/p/modplug/code/4679
Author: saga-games
Date: 2014-12-24 15:15:56 +0000 (Wed, 24 Dec 2014)
Log Message:
-----------
[New] Sample tab: Added new shortcuts to center waveform around loop points
Modified Paths:
--------------
trunk/OpenMPT/mptrack/CommandSet.cpp
trunk/OpenMPT/mptrack/CommandSet.h
trunk/OpenMPT/mptrack/View_smp.cpp
trunk/OpenMPT/mptrack/View_smp.h
Modified: trunk/OpenMPT/mptrack/CommandSet.cpp
===================================================================
--- trunk/OpenMPT/mptrack/CommandSet.cpp 2014-12-24 13:32:33 UTC (rev 4678)
+++ trunk/OpenMPT/mptrack/CommandSet.cpp 2014-12-24 15:15:56 UTC (rev 4679)
@@ -670,7 +670,12 @@
DefineKeyCommand(kcSampleUpsample, 1913, _T("Upsample"));
DefineKeyCommand(kcSampleDownsample, 1914, _T("Downsample"));
DefineKeyCommand(kcSampleResample, 1915, _T("Resample"));
+ DefineKeyCommand(kcSampleCenterLoopStart, 1916, _T("Center loop start in view"));
+ DefineKeyCommand(kcSampleCenterLoopEnd, 1917, _T("Center loop end in view"));
+ DefineKeyCommand(kcSampleCenterSustainStart, 1918, _T("Center sustain loop start in view"));
+ DefineKeyCommand(kcSampleCenterSustainEnd, 1919, _T("Center sustain loop end in view"));
+
// Add new key commands here.
#ifdef _DEBUG
Modified: trunk/OpenMPT/mptrack/CommandSet.h
===================================================================
--- trunk/OpenMPT/mptrack/CommandSet.h 2014-12-24 13:32:33 UTC (rev 4678)
+++ trunk/OpenMPT/mptrack/CommandSet.h 2014-12-24 15:15:56 UTC (rev 4679)
@@ -675,6 +675,10 @@
kcSampleZoomUp,
kcSampleZoomDown,
kcSampleZoomSelection,
+ kcSampleCenterLoopStart,
+ kcSampleCenterLoopEnd,
+ kcSampleCenterSustainStart,
+ kcSampleCenterSustainEnd,
kcSample8Bit,
kcSampleMonoMix,
kcSampleMonoLeft,
Modified: trunk/OpenMPT/mptrack/View_smp.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_smp.cpp 2014-12-24 13:32:33 UTC (rev 4678)
+++ trunk/OpenMPT/mptrack/View_smp.cpp 2014-12-24 15:15:56 UTC (rev 4679)
@@ -227,12 +227,7 @@
{
if(centeredSample != SmpLength(-1))
{
- // Center given sample in the view
- int scrollToSample = centeredSample >> (std::max(1, newZoom) - 1);
- scrollToSample -= (m_rcClient.Width() / 2) >> (-std::min(-1, newZoom) - 1);
-
- Limit(scrollToSample, 0, GetScrollLimit(SB_HORZ));
- SetScrollPos(SB_HORZ, scrollToSample);
+ ScrollToSample(centeredSample, false);
} else
{
const SmpLength nOldPos = ScrollPosToSamplePos(oldZoom);
@@ -243,6 +238,20 @@
}
+// Center given sample in the view
+void CViewSample::ScrollToSample(SmpLength centeredSample, bool refresh)
+//----------------------------------------------------------------------
+{
+ int scrollToSample = centeredSample >> (std::max(1, m_nZoom) - 1);
+ scrollToSample -= (m_rcClient.Width() / 2) >> (-std::min(-1, m_nZoom) - 1);
+
+ Limit(scrollToSample, 0, GetScrollLimit(SB_HORZ));
+ SetScrollPos(SB_HORZ, scrollToSample);
+
+ if(refresh) InvalidateRect(nullptr, FALSE);
+}
+
+
BOOL CViewSample::OnScrollBy(CSize sizeScroll, BOOL bDoScroll)
//------------------------------------------------------------
{
@@ -2919,6 +2928,24 @@
case kcSampleZoomUp: OnZoomUp(); return wParam;
case kcSampleZoomDown: OnZoomDown(); return wParam;
case kcSampleZoomSelection: OnZoomOnSel(); return wParam;
+ case kcSampleCenterLoopStart:
+ case kcSampleCenterLoopEnd:
+ case kcSampleCenterSustainStart:
+ case kcSampleCenterSustainEnd:
+ if(m_nZoom)
+ {
+ SmpLength point;
+ ModSample &sample = sndFile.GetSample(m_nSample);
+ switch(wParam)
+ {
+ case kcSampleCenterLoopStart: point = sample.nLoopStart; break;
+ case kcSampleCenterLoopEnd: point = sample.nLoopEnd; break;
+ case kcSampleCenterSustainStart: point = sample.nSustainStart; break;
+ case kcSampleCenterSustainEnd: point = sample.nSustainEnd; break;
+ }
+ ScrollToSample(point);
+ }
+ return wParam;
case kcPrevInstrument: OnPrevInstrument(); return wParam;
case kcNextInstrument: OnNextInstrument(); return wParam;
case kcEditSelectAll: OnEditSelectAll(); return wParam;
Modified: trunk/OpenMPT/mptrack/View_smp.h
===================================================================
--- trunk/OpenMPT/mptrack/View_smp.h 2014-12-24 13:32:33 UTC (rev 4678)
+++ trunk/OpenMPT/mptrack/View_smp.h 2014-12-24 15:15:56 UTC (rev 4679)
@@ -96,6 +96,7 @@
int GetZoomLevel(SmpLength length) const;
void DoZoom(int direction, const CPoint &zoomPoint = CPoint(-1, -1));
bool CanZoomSelection() const;
+ void ScrollToSample(SmpLength centeredSample, bool refresh = true);
SmpLength ScrollPosToSamplePos() const {return ScrollPosToSamplePos(m_nZoom);}
inline SmpLength ScrollPosToSamplePos(int nZoom) const;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2014-12-31 00:52:02
|
Revision: 4688
http://sourceforge.net/p/modplug/code/4688
Author: saga-games
Date: 2014-12-31 00:51:56 +0000 (Wed, 31 Dec 2014)
Log Message:
-----------
[Mod] Add default shortcuts for loop zooming
[Fix] Apparently, in some cases I do not understand some wrong values were written into keybindings files (only in release builds? compiler bug?)
Modified Paths:
--------------
trunk/OpenMPT/mptrack/CommandSet.cpp
trunk/OpenMPT/mptrack/res/defaultKeybindings.mkb
Modified: trunk/OpenMPT/mptrack/CommandSet.cpp
===================================================================
--- trunk/OpenMPT/mptrack/CommandSet.cpp 2014-12-31 00:36:43 UTC (rev 4687)
+++ trunk/OpenMPT/mptrack/CommandSet.cpp 2014-12-31 00:51:56 UTC (rev 4688)
@@ -1516,7 +1516,7 @@
if (!commands[cmd].isHidden)
{
fprintf(outStream, "%d:%d:%d:%d:%d\t\t//%s: %s (%s)\n",
- ctx, commands[cmd].UID, kc.Modifier(), kc.KeyCode(), kc.EventType(),
+ ctx, commands[cmd].UID, kc.Modifier(), kc.KeyCode(), kc.EventType().GetRaw(),
GetCommandText((CommandID)cmd), kc.GetKeyText(), kc.GetKeyEventText());
}
Modified: trunk/OpenMPT/mptrack/res/defaultKeybindings.mkb
===================================================================
--- trunk/OpenMPT/mptrack/res/defaultKeybindings.mkb 2014-12-31 00:36:43 UTC (rev 4687)
+++ trunk/OpenMPT/mptrack/res/defaultKeybindings.mkb 2014-12-31 00:51:56 UTC (rev 4688)
@@ -290,6 +290,10 @@
8:1386:0:107:1 //Zoom Out: NUM PLUS (KeyDown)
8:1387:0:109:1 //Zoom In: NUM SUB (KeyDown)
8:1882:0:32:1 //Zoom into Selection: Space (KeyDown)
+8:1916:2:49:1 //Center loop start in view: Ctrl+1 (KeyDown)
+8:1917:2:50:1 //Center loop end in view: Ctrl+2 (KeyDown)
+8:1918:2:51:1 //Center sustain loop start in view: Ctrl+3 (KeyDown)
+8:1919:2:52:1 //Center sustain loop end in view: Ctrl+4 (KeyDown)
8:1915:2:82:1 //Resample: Ctrl+R (KeyDown)
8:1784:2:73:1 //Invert Sample Phase: Ctrl+I (KeyDown)
8:1785:2:85:1 //Signed / Unsigned Conversion: Ctrl+U (KeyDown)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2014-12-31 17:43:49
|
Revision: 4692
http://sourceforge.net/p/modplug/code/4692
Author: saga-games
Date: 2014-12-31 17:43:42 +0000 (Wed, 31 Dec 2014)
Log Message:
-----------
[Imp] Make pattern headers DPI-aware.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Draw_pat.cpp
trunk/OpenMPT/mptrack/View_pat.cpp
trunk/OpenMPT/mptrack/View_pat.h
Modified: trunk/OpenMPT/mptrack/Draw_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Draw_pat.cpp 2014-12-31 11:35:42 UTC (rev 4691)
+++ trunk/OpenMPT/mptrack/Draw_pat.cpp 2014-12-31 17:43:42 UTC (rev 4692)
@@ -123,14 +123,22 @@
int oldx = m_szCell.cx, oldy = m_szCell.cy;
m_szHeader.cx = ROWHDR_WIDTH;
m_szHeader.cy = COLHDR_HEIGHT;
+ m_szPluginHeader.cx = 0;
+ m_szPluginHeader.cy = m_Status[psShowPluginNames] ? PLUGNAME_HEIGHT : 0;
if(m_Status[psShowVUMeters]) m_szHeader.cy += VUMETERS_HEIGHT;
- if(m_Status[psShowPluginNames]) m_szHeader.cy += PLUGNAME_HEIGHT;
m_szCell.cx = 4 + pfnt->nEltWidths[0];
if (m_nDetailLevel >= PatternCursor::instrColumn) m_szCell.cx += pfnt->nEltWidths[1];
if (m_nDetailLevel >= PatternCursor::volumeColumn) m_szCell.cx += pfnt->nEltWidths[2];
if (m_nDetailLevel >= PatternCursor::effectColumn) m_szCell.cx += pfnt->nEltWidths[3] + pfnt->nEltWidths[4];
m_szCell.cy = pfnt->nHeight;
+ const int dpiX = ::GetDeviceCaps(GetDC()->m_hDC, LOGPIXELSX);
+ const int dpiY = ::GetDeviceCaps(GetDC()->m_hDC, LOGPIXELSY);
+ m_szHeader.cx = MulDiv(m_szHeader.cx, dpiX, 96);
+ m_szHeader.cy = MulDiv(m_szHeader.cy, dpiY, 96);
+ m_szPluginHeader.cy = MulDiv(m_szPluginHeader.cy, dpiY, 96);
+ m_szHeader.cy += m_szPluginHeader.cy;
+
if(oldy != m_szCell.cy)
{
m_Dib.SetSize(m_Dib.GetWidth(), m_szCell.cy);
@@ -218,7 +226,7 @@
}
if (pt.x < 0) pt.x = 0;
- pt.x += ROWHDR_WIDTH;
+ pt.x += Util::ScalePixels(ROWHDR_WIDTH, GetDC());
pt.y = (cursor.GetRow() - yofs + m_nMidRow) * m_szCell.cy;
if (pt.y < 0) pt.y = 0;
@@ -459,6 +467,10 @@
ASSERT(pDC);
UpdateSizes();
if ((pModDoc = GetDocument()) == nullptr) return;
+
+ const int dpiY = ::GetDeviceCaps(pDC->m_hDC, LOGPIXELSY);
+ const int vuHeight = MulDiv(VUMETERS_HEIGHT, dpiY, 96);
+
GetClientRect(&rcClient);
hdc = pDC->m_hDC;
oldpen = SelectPen(hdc, CMainFrame::penDarkGray);
@@ -510,7 +522,7 @@
::FillRect(hdc, &r, CMainFrame::brushText);
}
- rect.bottom = rect.top + COLHDR_HEIGHT;
+ rect.bottom = rect.top + MulDiv(COLHDR_HEIGHT, dpiY, 96);
CRect insRect;
insRect.SetRect(xpaint, ypaint, xpaint+nColumnWidth / 8 + 3, ypaint + 16);
@@ -536,13 +548,13 @@
{
OldVUMeters[ncolhdr] = 0;
DrawChannelVUMeter(hdc, rect.left + 1, rect.bottom, ncolhdr);
- rect.top+=VUMETERS_HEIGHT;
- rect.bottom+=VUMETERS_HEIGHT;
+ rect.top += vuHeight;
+ rect.bottom += vuHeight;
}
if(m_Status[psShowPluginNames])
{
- rect.top+=PLUGNAME_HEIGHT;
- rect.bottom+=PLUGNAME_HEIGHT;
+ rect.top += m_szPluginHeader.cy;
+ rect.bottom += m_szPluginHeader.cy;
mixPlug = sndFile.ChnSettings[ncolhdr].nMixPlugin;
if (mixPlug)
wsprintf(s, "%d: %s", mixPlug, (sndFile.m_MixPlugins[mixPlug - 1]).pMixPlugin ? (sndFile.m_MixPlugins[mixPlug - 1]).GetName() : "[empty]");
@@ -1664,11 +1676,12 @@
const bool isPlaying = (pMainFrm->GetFollowSong(pModDoc) == m_hWnd);
int x = m_szHeader.cx;
CHANNELINDEX nChn = static_cast<CHANNELINDEX>(xofs);
+ const int yPos = rcClient.top + MulDiv(COLHDR_HEIGHT, ::GetDeviceCaps(hdc, LOGPIXELSY), 96);
while ((nChn < pModDoc->GetNumChannels()) && (x < rcClient.right))
{
ChnVUMeters[nChn] = (WORD)pnotify->pos[nChn];
if ((!isPlaying) || pnotify->type[Notification::Stop]) ChnVUMeters[nChn] = 0;
- DrawChannelVUMeter(hdc, x + 1, rcClient.top + COLHDR_HEIGHT, nChn);
+ DrawChannelVUMeter(hdc, x + 1, rcClient.top + yPos, nChn);
nChn++;
x += m_szCell.cx;
}
Modified: trunk/OpenMPT/mptrack/View_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_pat.cpp 2014-12-31 11:35:42 UTC (rev 4691)
+++ trunk/OpenMPT/mptrack/View_pat.cpp 2014-12-31 17:43:42 UTC (rev 4692)
@@ -32,8 +32,6 @@
OPENMPT_NAMESPACE_BEGIN
-#define PLUGNAME_HEIGHT 16 //rewbs.patPlugName
-
#pragma warning(disable:4244) //"conversion from 'type1' to 'type2', possible loss of data"
FindReplace CViewPattern::m_findReplace =
@@ -495,7 +493,7 @@
xofs = GetXScrollPos();
yofs = GetYScrollPos();
rect.SetRect(m_szHeader.cx, 0, m_szHeader.cx + GetColumnWidth() /*- 2*/, m_szHeader.cy);
- plugRect.SetRect(m_szHeader.cx, m_szHeader.cy-PLUGNAME_HEIGHT, m_szHeader.cx + GetColumnWidth() - 2, m_szHeader.cy); //rewbs.patPlugNames
+ plugRect.SetRect(m_szHeader.cx, m_szHeader.cy - m_szPluginHeader.cy, m_szHeader.cx + GetColumnWidth() - 2, m_szHeader.cy); //rewbs.patPlugNames
const CHANNELINDEX nmax = pSndFile->GetNumChannels();
// Checking channel headers
@@ -707,7 +705,7 @@
{
// Open quick channel properties dialog if we're middle-clicking a channel header.
CPoint point(GET_X_LPARAM(pMsg->lParam), GET_Y_LPARAM(pMsg->lParam));
- if(point.y < m_szHeader.cy - (m_Status[psShowPluginNames] ? PLUGNAME_HEIGHT : 0))
+ if(point.y < m_szHeader.cy - m_szPluginHeader.cy)
{
PatternCursor cursor = GetPositionFromPoint(point);
if(cursor.GetChannel() < GetDocument()->GetNumChannels())
@@ -1138,7 +1136,7 @@
PatternCursor pointCursor(GetPositionFromPoint(point));
SetCapture();
- if(point.x >= m_szHeader.cx && point.y <= m_szHeader.cy - (m_Status[psShowPluginNames] ? PLUGNAME_HEIGHT : 0))
+ if(point.x >= m_szHeader.cx && point.y <= m_szHeader.cy - m_szPluginHeader.cy)
{
// Click on channel header
if (nFlags & MK_CONTROL)
@@ -1435,7 +1433,7 @@
//------ Plugin Header Menu --------- :
if(m_Status[psShowPluginNames] &&
- (pt.y > m_szHeader.cy-PLUGNAME_HEIGHT) && (pt.y < m_szHeader.cy))
+ (pt.y > m_szHeader.cy - m_szPluginHeader.cy) && (pt.y < m_szHeader.cy))
{
BuildPluginCtxMenu(hMenu, nChn, pSndFile);
}
Modified: trunk/OpenMPT/mptrack/View_pat.h
===================================================================
--- trunk/OpenMPT/mptrack/View_pat.h 2014-12-31 11:35:42 UTC (rev 4691)
+++ trunk/OpenMPT/mptrack/View_pat.h 2014-12-31 17:43:42 UTC (rev 4692)
@@ -159,7 +159,7 @@
CFastBitmap m_Dib;
CEditCommand *m_pEditWnd;
CPatternGotoDialog *m_pGotoWnd;
- SIZE m_szHeader, m_szCell;
+ CSize m_szHeader, m_szPluginHeader, m_szCell;
UINT m_nMidRow, m_nSpacing, m_nAccelChar, m_nLastPlayedRow, m_nLastPlayedOrder;
FlagSet<PatternStatus> m_Status;
ROWINDEX m_nPlayRow;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2014-12-31 17:59:36
|
Revision: 4693
http://sourceforge.net/p/modplug/code/4693
Author: saga-games
Date: 2014-12-31 17:59:23 +0000 (Wed, 31 Dec 2014)
Log Message:
-----------
[Imp] Make plugin selector DPI-aware
Modified Paths:
--------------
trunk/OpenMPT/mptrack/SelectPluginDialog.cpp
trunk/OpenMPT/mptrack/SelectPluginDialog.h
Modified: trunk/OpenMPT/mptrack/SelectPluginDialog.cpp
===================================================================
--- trunk/OpenMPT/mptrack/SelectPluginDialog.cpp 2014-12-31 17:43:42 UTC (rev 4692)
+++ trunk/OpenMPT/mptrack/SelectPluginDialog.cpp 2014-12-31 17:59:23 UTC (rev 4693)
@@ -105,10 +105,12 @@
::EnableWindow(::GetDlgItem(m_hWnd, IDOK), FALSE);
}
- MoveWindow(TrackerSettings::Instance().gnPlugWindowX,
- TrackerSettings::Instance().gnPlugWindowY,
- TrackerSettings::Instance().gnPlugWindowWidth,
- TrackerSettings::Instance().gnPlugWindowHeight);
+ const int dpiX = ::GetDeviceCaps(GetDC()->m_hDC, LOGPIXELSX);
+ const int dpiY = ::GetDeviceCaps(GetDC()->m_hDC, LOGPIXELSY);
+ MoveWindow(MulDiv(TrackerSettings::Instance().gnPlugWindowX, dpiX, 96),
+ MulDiv(TrackerSettings::Instance().gnPlugWindowY, dpiY, 96),
+ MulDiv(TrackerSettings::Instance().gnPlugWindowWidth, dpiX, 96),
+ MulDiv(TrackerSettings::Instance().gnPlugWindowHeight, dpiY, 96));
UpdatePluginsList();
OnSelChanged(NULL, NULL);
@@ -189,12 +191,7 @@
}
//remember window size:
- RECT rect;
- GetWindowRect(&rect);
- TrackerSettings::Instance().gnPlugWindowX = rect.left;
- TrackerSettings::Instance().gnPlugWindowY = rect.top;
- TrackerSettings::Instance().gnPlugWindowWidth = rect.right - rect.left;
- TrackerSettings::Instance().gnPlugWindowHeight = rect.bottom - rect.top;
+ SaveWindowPos();
if(changed)
{
@@ -216,17 +213,25 @@
//-------------------------------
{
//remember window size:
- RECT rect;
- GetWindowRect(&rect);
- TrackerSettings::Instance().gnPlugWindowX = rect.left;
- TrackerSettings::Instance().gnPlugWindowY = rect.top;
- TrackerSettings::Instance().gnPlugWindowWidth = rect.right - rect.left;
- TrackerSettings::Instance().gnPlugWindowHeight = rect.bottom - rect.top;
-
+ SaveWindowPos();
CDialog::OnCancel();
}
+void CSelectPluginDlg::SaveWindowPos() const
+//------------------------------------------
+{
+ CRect rect;
+ GetWindowRect(&rect);
+ const int dpiX = ::GetDeviceCaps(::GetDC(m_hWnd), LOGPIXELSX);
+ const int dpiY = ::GetDeviceCaps(::GetDC(m_hWnd), LOGPIXELSY);
+ TrackerSettings::Instance().gnPlugWindowX = MulDiv(rect.left, 96, dpiX);
+ TrackerSettings::Instance().gnPlugWindowY = MulDiv(rect.top, 96, dpiY);
+ TrackerSettings::Instance().gnPlugWindowWidth = MulDiv(rect.Width(), 96, dpiY);
+ TrackerSettings::Instance().gnPlugWindowHeight = MulDiv(rect.Height(), 96, dpiX);
+}
+
+
BOOL CSelectPluginDlg::PreTranslateMessage(MSG *pMsg)
//---------------------------------------------------
{
@@ -723,21 +728,26 @@
{
CDialog::OnSize(nType, cx, cy);
+ const int dpiX = ::GetDeviceCaps(GetDC()->m_hDC, LOGPIXELSX);
+ const int dpiY = ::GetDeviceCaps(GetDC()->m_hDC, LOGPIXELSY);
+
if (m_treePlugins)
{
- m_treePlugins.MoveWindow(8, 36, cx - 109, cy - 88, FALSE);
+ m_treePlugins.MoveWindow(MulDiv(8, dpiX, 96), MulDiv(36, dpiY, 96), cx - MulDiv(109, dpiX, 96), cy - MulDiv(88, dpiY, 96), FALSE);
- GetDlgItem(IDC_STATIC_VSTNAMEFILTER)->MoveWindow(8, 11, 40, 21, FALSE);
- GetDlgItem(IDC_NAMEFILTER)->MoveWindow(40, 8, cx - 141, 21, FALSE);
- GetDlgItem(IDC_TEXT_CURRENT_VSTPLUG)->MoveWindow(8, cy - 45, cx - 22, 20, FALSE);
- m_chkBridge.MoveWindow(8, cy - 25, 110, 20, FALSE);
- m_chkShare.MoveWindow(120, cy - 25, cx - 128, 20, FALSE);
- const int rightOff = cx - 90; // Offset of right button column
- GetDlgItem(IDOK)->MoveWindow( rightOff, 8, 80, 23, FALSE);
- GetDlgItem(IDCANCEL)->MoveWindow( rightOff, 39, 80, 23, FALSE);
- GetDlgItem(IDC_BUTTON1)->MoveWindow(rightOff, cy - 133, 80, 23, FALSE);
- GetDlgItem(IDC_BUTTON3)->MoveWindow(rightOff, cy - 105, 80, 23, FALSE);
- GetDlgItem(IDC_BUTTON2)->MoveWindow(rightOff, cy - 77, 80, 23, FALSE);
+ GetDlgItem(IDC_STATIC_VSTNAMEFILTER)->MoveWindow(MulDiv(8, dpiX, 96), MulDiv(11, dpiY, 96), MulDiv(40, dpiX, 96), MulDiv(21, dpiY, 96), FALSE);
+ GetDlgItem(IDC_NAMEFILTER)->MoveWindow(MulDiv(40, dpiX, 96), MulDiv(8, dpiY, 96), cx - MulDiv(141, dpiX, 96), MulDiv(21, dpiY, 96), FALSE);
+ GetDlgItem(IDC_TEXT_CURRENT_VSTPLUG)->MoveWindow(MulDiv(8, dpiX, 96), cy - MulDiv(45, dpiY, 96), cx - MulDiv(22, dpiX, 96), MulDiv(20, dpiY, 96), FALSE);
+ m_chkBridge.MoveWindow(MulDiv(8, dpiX, 96), cy - MulDiv(25, dpiY, 96), MulDiv(110, dpiX, 96), MulDiv(20, dpiY, 96), FALSE);
+ m_chkShare.MoveWindow(MulDiv(120, dpiX, 96), cy - MulDiv(25, dpiY, 96), cx - MulDiv(128, dpiX, 96), MulDiv(20, dpiY, 96), FALSE);
+
+ const int rightOff = cx - MulDiv(90, dpiX, 96); // Offset of right button column
+ const int buttonWidth = MulDiv(80, dpiX, 96), buttonHeight = MulDiv(23, dpiY, 96);
+ GetDlgItem(IDOK)->MoveWindow( rightOff, MulDiv(8, dpiY, 96), buttonWidth, buttonHeight, FALSE);
+ GetDlgItem(IDCANCEL)->MoveWindow( rightOff, MulDiv(39, dpiY, 96), buttonWidth, buttonHeight, FALSE);
+ GetDlgItem(IDC_BUTTON1)->MoveWindow(rightOff, cy - MulDiv(133, dpiY, 96), buttonWidth, buttonHeight, FALSE);
+ GetDlgItem(IDC_BUTTON3)->MoveWindow(rightOff, cy - MulDiv(105, dpiY, 96), buttonWidth, buttonHeight, FALSE);
+ GetDlgItem(IDC_BUTTON2)->MoveWindow(rightOff, cy - MulDiv(77, dpiY, 96), buttonWidth, buttonHeight, FALSE);
Invalidate();
}
}
@@ -745,8 +755,8 @@
void CSelectPluginDlg::OnGetMinMaxInfo(MINMAXINFO* lpMMI)
//-------------------------------------------------------
{
- lpMMI->ptMinTrackSize.x = 350;
- lpMMI->ptMinTrackSize.y = 270;
+ lpMMI->ptMinTrackSize.x = MulDiv(350, ::GetDeviceCaps(GetDC()->m_hDC, LOGPIXELSX), 96);
+ lpMMI->ptMinTrackSize.y = MulDiv(270, ::GetDeviceCaps(GetDC()->m_hDC, LOGPIXELSY), 96);
CDialog::OnGetMinMaxInfo(lpMMI);
}
Modified: trunk/OpenMPT/mptrack/SelectPluginDialog.h
===================================================================
--- trunk/OpenMPT/mptrack/SelectPluginDialog.h 2014-12-31 17:43:42 UTC (rev 4692)
+++ trunk/OpenMPT/mptrack/SelectPluginDialog.h 2014-12-31 17:59:23 UTC (rev 4693)
@@ -42,6 +42,7 @@
protected:
VSTPluginLib *GetSelectedPlugin() { return reinterpret_cast<VSTPluginLib *>(m_treePlugins.GetItemData(m_treePlugins.GetSelectedItem())); }
+ void SaveWindowPos() const;
void DoClose();
void UpdatePluginsList(VstInt32 forceSelect = 0);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2014-12-31 21:32:46
|
Revision: 4694
http://sourceforge.net/p/modplug/code/4694
Author: saga-games
Date: 2014-12-31 21:32:40 +0000 (Wed, 31 Dec 2014)
Log Message:
-----------
[Imp] Make channel manager DPI-aware.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/ChannelManagerDlg.cpp
trunk/OpenMPT/mptrack/ChannelManagerDlg.h
trunk/OpenMPT/mptrack/Draw_pat.cpp
Modified: trunk/OpenMPT/mptrack/ChannelManagerDlg.cpp
===================================================================
--- trunk/OpenMPT/mptrack/ChannelManagerDlg.cpp 2014-12-31 17:59:23 UTC (rev 4693)
+++ trunk/OpenMPT/mptrack/ChannelManagerDlg.cpp 2014-12-31 21:32:40 UTC (rev 4694)
@@ -16,6 +16,10 @@
OPENMPT_NAMESPACE_BEGIN
+#define CM_BT_LEFT 1
+#define CM_BT_RIGHT 2
+#define CM_NB_COLS 8
+#define CM_BT_HEIGHT 22
///////////////////////////////////////////////////////////
// CChannelManagerDlg
@@ -109,6 +113,7 @@
return show;
}
+
CChannelManagerDlg::CChannelManagerDlg(void)
{
mouseTracking = false;
@@ -139,13 +144,13 @@
TCITEM tie;
tie.mask = TCIF_TEXT | TCIF_IMAGE;
tie.iImage = -1;
- tie.pszText = "Solo/Mute";
+ tie.pszText = _T("Solo/Mute");
TabCtrl_InsertItem(menu, 0, &tie);
- tie.pszText = "Record select";
+ tie.pszText = _T("Record select");
TabCtrl_InsertItem(menu, 1, &tie);
- tie.pszText = "Fx plugins";
+ tie.pszText = _T("Plugins");
TabCtrl_InsertItem(menu, 2, &tie);
- tie.pszText = "Reorder/Remove";
+ tie.pszText = _T("Reorder/Remove");
TabCtrl_InsertItem(menu, 3, &tie);
currentTab = 0;
@@ -169,12 +174,10 @@
void CChannelManagerDlg::OnApply()
{
CMainFrame * pMainFrm = CMainFrame::GetMainFrame();
- CModDoc *pModDoc = pMainFrm ? pMainFrm->GetActiveDoc() : NULL;
+ CModDoc *pModDoc = pMainFrm ? pMainFrm->GetActiveDoc() : nullptr;
if(!pModDoc) return;
- CriticalSection cs;
-
CHANNELINDEX nChannels, newpat[MAX_BASECHANNELS], newMemory[4][MAX_BASECHANNELS];
// Count new number of channels , copy pattern pointers & manager internal store memory
@@ -194,6 +197,7 @@
//Creating new order-vector for ReArrangeChannels.
std::vector<CHANNELINDEX> newChnOrder(newpat, newpat + nChannels);
+ CriticalSection cs;
if(pModDoc->ReArrangeChannels(newChnOrder) != nChannels)
{
cs.Leave();
@@ -535,8 +539,8 @@
::ShowWindow(::GetDlgItem(m_hWnd, IDC_BUTTON1),SW_HIDE);
break;
case 2:
- SetDlgItemText(IDC_BUTTON5, "Enable fx");
- SetDlgItemText(IDC_BUTTON6, "Disable fx");
+ SetDlgItemText(IDC_BUTTON5, "Enable FX");
+ SetDlgItemText(IDC_BUTTON6, "Disable FX");
::ShowWindow(::GetDlgItem(m_hWnd, IDC_BUTTON5),SW_SHOW);
::ShowWindow(::GetDlgItem(m_hWnd, IDC_BUTTON6),SW_SHOW);
::ShowWindow(::GetDlgItem(m_hWnd, IDC_BUTTON1),SW_HIDE);
@@ -607,6 +611,9 @@
CRect wnd;
GetClientRect(&wnd);
+ const int dpiX = ::GetDeviceCaps(::GetDC(m_hWnd), LOGPIXELSX);
+ const int dpiY = ::GetDeviceCaps(::GetDC(m_hWnd), LOGPIXELSY);
+
// Move butttons to bottom of the window
static const int buttons[] = { IDC_BUTTON1, IDC_BUTTON2, IDC_BUTTON3, IDC_BUTTON4, IDC_BUTTON5, IDC_BUTTON6 };
for(size_t i = 0; i < CountOf(buttons); i++)
@@ -617,11 +624,14 @@
CRect btn;
button->GetClientRect(&btn);
button->MapWindowPoints(this, &btn);
- button->SetWindowPos(nullptr, btn.left, wnd.Height() - btn.Height() - 3, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
+ button->SetWindowPos(nullptr, btn.left, wnd.Height() - btn.Height() - MulDiv(3, dpiY, 96), 0, 0, SWP_NOSIZE | SWP_NOZORDER);
}
}
- wnd.DeflateRect(10, 38, 8, 30);
+ wnd.DeflateRect(MulDiv(10, dpiX, 96), MulDiv(38, dpiY, 96), MulDiv(8, dpiX, 96), MulDiv(30, dpiY, 96));
+ m_drawableArea = wnd;
+ buttonHeight = MulDiv(CM_BT_HEIGHT, dpiY, 96);
+
if(bkgnd) DeleteObject(bkgnd);
bkgnd = ::CreateCompatibleBitmap(::GetDC(m_hWnd), wnd.Width(), wnd.Height());
if(!moveRect && bkgnd)
@@ -672,6 +682,9 @@
PAINTSTRUCT pDC;
::BeginPaint(m_hWnd,&pDC);
+ const int dpiX = ::GetDeviceCaps(pDC.hdc, LOGPIXELSX);
+ const int dpiY = ::GetDeviceCaps(pDC.hdc, LOGPIXELSY);
+
CHAR s[256];
UINT c=0,l=0;
CHANNELINDEX nChannels = pModDoc->GetNumChannels();
@@ -679,22 +692,21 @@
CRect client,btn;
GetWindowRect(&btn);
- GetClientRect(&client);
- client.SetRect(client.left + 10,client.top + 38,client.right - 8,client.bottom - 30);
+ client = m_drawableArea;
- UINT chnSizeX = (client.right - client.left) / CM_NB_COLS;
- UINT chnSizeY = (client.bottom - client.top) / (int)nLines;
+ int chnSizeX = client.Width() / CM_NB_COLS;
+ int chnSizeY = client.Height() / (int)nLines;
- if(chnSizeY != CM_BT_HEIGHT)
+ if(chnSizeY != buttonHeight)
{
// Window height is not sufficient => resize window
::EndPaint(m_hWnd,&pDC);
cs.Leave();
- CWnd::SetWindowPos(NULL, 0, 0, btn.Width(), btn.Height() + (CM_BT_HEIGHT - chnSizeY) * nLines, SWP_NOMOVE | SWP_NOZORDER);
+ CWnd::SetWindowPos(NULL, 0, 0, btn.Width(), btn.Height() + (buttonHeight - chnSizeY) * nLines, SWP_NOMOVE | SWP_NOZORDER);
return;
}
- chnSizeY = CM_BT_HEIGHT;
+ chnSizeY = buttonHeight;
if(currentTab == 3 && moveRect && bkgnd)
{
@@ -704,25 +716,7 @@
::BitBlt(pDC.hdc,client.left,client.top,client.Width(),client.Height(),bdc,0,0,SRCCOPY);
::SelectObject(bdc,(HBITMAP)NULL);
::DeleteDC(bdc);
-/*
- UINT n;
- POINT p;
- CRect r;
- p.x = mx;
- p.y = my;
- BOOL hit = ButtonHit(p,&n,&r);
- if(hit && !select[n]){
- r.top += 3;
- r.left += 3;
- FrameRect(pDC.hdc,&r,CMainFrame::brushBlack);
- r.top += 3;
- r.left += 3;
- r.bottom -= 3;
- r.right = r.left + chnSizeX / 7 - 6;
- FillRect(pDC.hdc,&r,CMainFrame::brushWhite);
- FrameRect(pDC.hdc,&r,CMainFrame::brushBlack);
- }
-*/
+
for(CHANNELINDEX nChn = 0; nChn < nChannels; nChn++)
{
CHANNELINDEX nThisChn = pattern[nChn];
@@ -741,7 +735,7 @@
}
GetClientRect(&client);
- client.SetRect(client.left + 2,client.top + 32,client.right - 2,client.bottom - 24);
+ client.SetRect(client.left + MulDiv(2, dpiX, 96), client.top + MulDiv(32, dpiY, 96), client.right - MulDiv(2, dpiX, 96), client.bottom - MulDiv(24, dpiY, 96));
CRect intersection;
BOOL ok = intersection.IntersectRect(&pDC.rcPaint,&client);
@@ -768,17 +762,18 @@
else
wsprintf(s, "Channel %d", nThisChn + 1);
- btn.left = client.left + c * chnSizeX + 3;
- btn.right = btn.left + chnSizeX - 3;
- btn.top = client.top + l * chnSizeY + 3;
- btn.bottom = btn.top + chnSizeY - 3;
+ const int borderX = MulDiv(3, dpiX, 96), borderY = MulDiv(3, dpiY, 96);
+ btn.left = client.left + c * chnSizeX + borderX;
+ btn.right = btn.left + chnSizeX - borderX;
+ btn.top = client.top + l * chnSizeY + borderY;
+ btn.bottom = btn.top + chnSizeY - borderY;
ok = intersection.IntersectRect(&pDC.rcPaint, &client);
if(ok) DrawChannelButton(pDC.hdc, &btn, s, select[nThisChn], removed[nThisChn] ? FALSE : TRUE, DT_RIGHT | DT_VCENTER, NULL);
btn.right = btn.left + chnSizeX / 7;
- btn.DeflateRect(3, 3, 3, 3);
+ btn.DeflateRect(borderX, borderY, borderX, borderY);
switch(currentTab)
{
@@ -818,8 +813,8 @@
if(c >= CM_NB_COLS) { c = 0; l++; }
}
- DeleteObject((HBRUSH)green);
- DeleteObject((HBRUSH)red);
+ DeleteBrush(green);
+ DeleteBrush(red);
::EndPaint(m_hWnd,&pDC);
}
@@ -832,9 +827,7 @@
bool CChannelManagerDlg::ButtonHit( CPoint point, CHANNELINDEX * id, CRect * invalidate )
{
- CRect client;
- GetClientRect(&client);
- client.SetRect(client.left + 10,client.top + 38,client.right - 8,client.bottom - 30);
+ const CRect &client = m_drawableArea;
if(!PtInRect(client,point)) return false;
@@ -850,8 +843,8 @@
int x = point.x - client.left;
int y = point.y - client.top;
- int dx = (client.right - client.left) / (int)nColns;
- int dy = CM_BT_HEIGHT;
+ int dx = client.Width() / (int)nColns;
+ int dy = buttonHeight;
x = x / dx;
y = y / dy;
@@ -1089,12 +1082,10 @@
{
if(!pModDoc->IsChannelSolo(n) || pModDoc->IsChannelMuted(n))
{
- GetClientRect(&client);
pModDoc->MuteChannel(n, false);
pModDoc->SoloChannel(n, true);
for(CHANNELINDEX nChn = 0; nChn < pModDoc->GetNumChannels(); nChn++) if(nChn != n) pModDoc->MuteChannel(nChn, true);
- client.SetRect(client.left + 10,client.top + 38,client.right - 8,client.bottom - 30);
- invalidate = client;
+ invalidate = client = m_drawableArea;
}
else pModDoc->SoloChannel(n, false);
} else
@@ -1138,8 +1129,7 @@
if(select[n] || button == 0)
{
- GetClientRect(&client);
- client.SetRect(client.left + 10,client.top + 38,client.right - 8,client.bottom - 30);
+ invalidate = client = m_drawableArea;
if(!bkgnd) bkgnd = ::CreateCompatibleBitmap(::GetDC(m_hWnd),client.Width(),client.Height());
if(!moveRect && bkgnd){
HDC bdc = ::CreateCompatibleDC(::GetDC(m_hWnd));
@@ -1148,7 +1138,6 @@
::SelectObject(bdc,(HBITMAP)NULL);
::DeleteDC(bdc);
}
- invalidate = client;
moveRect = true;
}
break;
@@ -1159,9 +1148,7 @@
InvalidateRect(&invalidate, FALSE);
} else
{
- GetClientRect(&client);
- client.SetRect(client.left + 10,client.top + 38,client.right - 8,client.bottom - 30);
- InvalidateRect(&client, FALSE);
+ InvalidateRect(&m_drawableArea, FALSE);
}
}
Modified: trunk/OpenMPT/mptrack/ChannelManagerDlg.h
===================================================================
--- trunk/OpenMPT/mptrack/ChannelManagerDlg.h 2014-12-31 17:59:23 UTC (rev 4693)
+++ trunk/OpenMPT/mptrack/ChannelManagerDlg.h 2014-12-31 21:32:40 UTC (rev 4694)
@@ -12,11 +12,6 @@
OPENMPT_NAMESPACE_BEGIN
-#define CM_BT_LEFT 1
-#define CM_BT_RIGHT 2
-#define CM_NB_COLS 8
-#define CM_BT_HEIGHT 22
-
//======================================
class CChannelManagerDlg: public CDialog
//======================================
@@ -47,6 +42,7 @@
bool select[MAX_BASECHANNELS];
bool state[MAX_BASECHANNELS];
CRect move[MAX_BASECHANNELS];
+ CRect m_drawableArea;
void * parentCtrl;
bool mouseTracking;
CHANNELINDEX nChannelsOld;
@@ -58,6 +54,7 @@
int omx,omy;
bool show;
int mx,my;
+ int buttonHeight;
bool ButtonHit(CPoint point, CHANNELINDEX * id, CRect * invalidate);
void MouseEvent(UINT nFlags,CPoint point, BYTE button);
Modified: trunk/OpenMPT/mptrack/Draw_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Draw_pat.cpp 2014-12-31 17:59:23 UTC (rev 4693)
+++ trunk/OpenMPT/mptrack/Draw_pat.cpp 2014-12-31 21:32:40 UTC (rev 4694)
@@ -468,8 +468,11 @@
UpdateSizes();
if ((pModDoc = GetDocument()) == nullptr) return;
+ const int dpiX = ::GetDeviceCaps(pDC->m_hDC, LOGPIXELSX);
const int dpiY = ::GetDeviceCaps(pDC->m_hDC, LOGPIXELSY);
const int vuHeight = MulDiv(VUMETERS_HEIGHT, dpiY, 96);
+ const int colHeight = MulDiv(COLHDR_HEIGHT, dpiY, 96);
+ const int recordInsX = MulDiv(3, dpiY, 96);
GetClientRect(&rcClient);
hdc = pDC->m_hDC;
@@ -522,10 +525,10 @@
::FillRect(hdc, &r, CMainFrame::brushText);
}
- rect.bottom = rect.top + MulDiv(COLHDR_HEIGHT, dpiY, 96);
+ rect.bottom = rect.top + colHeight;
CRect insRect;
- insRect.SetRect(xpaint, ypaint, xpaint+nColumnWidth / 8 + 3, ypaint + 16);
+ insRect.SetRect(xpaint, ypaint, xpaint + nColumnWidth / 8 + recordInsX, ypaint + colHeight);
if (pModDoc->IsChannelRecord1(static_cast<CHANNELINDEX>(ncolhdr)))
{
FrameRect(hdc,&rect,CMainFrame::brushGray);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2015-01-10 18:53:15
|
Revision: 4711
http://sourceforge.net/p/modplug/code/4711
Author: saga-games
Date: 2015-01-10 18:53:02 +0000 (Sat, 10 Jan 2015)
Log Message:
-----------
[Ref] Do a bit of general refactoring in the autosaver code and remove the hint about ITP instruments in the error message.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/AutoSaver.cpp
trunk/OpenMPT/mptrack/AutoSaver.h
Modified: trunk/OpenMPT/mptrack/AutoSaver.cpp
===================================================================
--- trunk/OpenMPT/mptrack/AutoSaver.cpp 2015-01-10 17:06:12 UTC (rev 4710)
+++ trunk/OpenMPT/mptrack/AutoSaver.cpp 2015-01-10 18:53:02 UTC (rev 4711)
@@ -29,8 +29,8 @@
// Construction/Destruction
///////////////////////////
-CAutoSaver::CAutoSaver(bool enabled, int saveInterval, int backupHistory, bool useOriginalPath, mpt::PathString path)
-//-------------------------------------------------------------------------------------------------------------------
+CAutoSaver::CAutoSaver(bool enabled, uint32_t saveInterval, uint32_t backupHistory, bool useOriginalPath, mpt::PathString path)
+//-----------------------------------------------------------------------------------------------------------------------------
: m_bSaveInProgress(false)
, m_nLastSave(timeGetTime())
, m_bEnabled(enabled)
@@ -71,7 +71,7 @@
} else
{
m_bEnabled = false;
- Reporting::Warning("Warning: Autosave failed and has been disabled. Please:\n- Review your autosave paths\n- Check available diskspace & filesystem access rights\n- If you are using the ITP format, ensure all instruments exist as independant .iti files");
+ Reporting::Warning("Warning: Auto Save failed and has been disabled. Please:\n- Review your Auto Save paths\n- Check available disk space and filesystem access rights");
success = false;
}
}
@@ -91,10 +91,10 @@
///////////////////////////
-bool CAutoSaver::CheckTimer(DWORD curTime)
+bool CAutoSaver::CheckTimer(DWORD curTime)
//----------------------------------------
{
- DWORD curInterval = curTime-m_nLastSave;
+ DWORD curInterval = curTime - m_nLastSave;
return (curInterval >= m_nSaveInterval);
}
@@ -102,7 +102,6 @@
mpt::PathString CAutoSaver::BuildFileName(CModDoc &modDoc)
//--------------------------------------------------------
{
- std::wstring timeStamp = mpt::ToWide((CTime::GetCurrentTime()).Format("%Y%m%d.%H%M%S"));
mpt::PathString name;
if(m_bUseOriginalPath)
@@ -125,9 +124,8 @@
name = m_csPath + mpt::PathString::FromCStringSilent(modDoc.GetTitle()).SanitizeComponent();
}
- name += MPT_PATHSTRING(".AutoSave."); //append backup tag
- name += mpt::PathString::FromWide(timeStamp); //append timestamp
- name += MPT_PATHSTRING("."); //append extension
+ const CString timeStamp = (CTime::GetCurrentTime()).Format(_T(".AutoSave.%Y%m%d.%H%M%S."));
+ name += mpt::PathString::FromCString(timeStamp); //append backtup tag + timestamp
name += mpt::PathString::FromUTF8(modDoc.GetrSoundFile().GetModSpecifications().fileExtension);
return name;
@@ -147,7 +145,7 @@
ScopedLogCapturer logcapturer(modDoc, "", nullptr, false);
bool success = false;
- switch(modDoc.GetModType())
+ switch(modDoc.GetrSoundFile().GetBestSaveFormat())
{
case MOD_TYPE_MOD:
success = sndFile.SaveMod(fileName);
@@ -175,8 +173,8 @@
}
-void CAutoSaver::CleanUpBackups(CModDoc &modDoc)
-//----------------------------------------------
+void CAutoSaver::CleanUpBackups(const CModDoc &modDoc)
+//----------------------------------------------------
{
mpt::PathString path;
@@ -216,7 +214,7 @@
}
std::sort(foundfiles.begin(), foundfiles.end());
- while(foundfiles.size() > m_nBackupHistory)
+ while(foundfiles.size() > (size_t)m_nBackupHistory)
{
DeleteFileW(foundfiles[0].AsNative().c_str());
foundfiles.erase(foundfiles.begin());
Modified: trunk/OpenMPT/mptrack/AutoSaver.h
===================================================================
--- trunk/OpenMPT/mptrack/AutoSaver.h 2015-01-10 17:06:12 UTC (rev 4710)
+++ trunk/OpenMPT/mptrack/AutoSaver.h 2015-01-10 18:53:02 UTC (rev 4711)
@@ -20,8 +20,8 @@
{
public:
//Cons/Destr
- CAutoSaver(bool enabled=true, int saveInterval=10, int backupHistory=3,
- bool useOriginalPath=true, mpt::PathString path=mpt::PathString());
+ CAutoSaver(bool enabled = true, uint32_t saveInterval = 10, uint32_t backupHistory = 3,
+ bool useOriginalPath = true, mpt::PathString path = mpt::PathString());
//Work
bool DoSave(DWORD curTime);
@@ -33,19 +33,19 @@
bool GetUseOriginalPath() const { return m_bUseOriginalPath; }
void SetPath(const mpt::PathString &path) { m_csPath = path; }
mpt::PathString GetPath() const { return m_csPath; }
- void SetHistoryDepth(int history) { m_nBackupHistory = Clamp(history, 1, 1000); }
- int GetHistoryDepth() const { return m_nBackupHistory; }
- void SetSaveInterval(int minutes)
+ void SetHistoryDepth(uint32_t history) { m_nBackupHistory = Clamp(history, 1u, 1000u); }
+ uint32_t GetHistoryDepth() const { return m_nBackupHistory; }
+ void SetSaveInterval(uint32_t minutes)
{
- m_nSaveInterval = Clamp(minutes, 1, 10000) * 60 * 1000; //minutes to milliseconds
+ m_nSaveInterval = Clamp(minutes, 1u, 10000u) * 60u * 1000u; //minutes to milliseconds
}
- int GetSaveInterval() const { return m_nSaveInterval / 60 / 1000; }
+ uint32_t GetSaveInterval() const { return m_nSaveInterval / 60u / 1000u; }
//internal implementation
private:
bool SaveSingleFile(CModDoc &modDoc);
mpt::PathString BuildFileName(CModDoc &modDoc);
- void CleanUpBackups(CModDoc &modDoc);
+ void CleanUpBackups(const CModDoc &modDoc);
bool CheckTimer(DWORD curTime);
//internal implementation members
@@ -56,8 +56,8 @@
bool m_bEnabled;
DWORD m_nLastSave;
- DWORD m_nSaveInterval;
- size_t m_nBackupHistory;
+ uint32_t m_nSaveInterval;
+ uint32_t m_nBackupHistory;
bool m_bUseOriginalPath;
mpt::PathString m_csPath;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2015-01-23 22:48:05
|
Revision: 4731
http://sourceforge.net/p/modplug/code/4731
Author: saga-games
Date: 2015-01-23 22:47:51 +0000 (Fri, 23 Jan 2015)
Log Message:
-----------
[Imp] Sample tab: If necessary, "center loop x" shortcuts automatically zoom into the sample.
[Fix] Keyboard config dialog: It was possible to accidentally click the conflict message box away, making the dialog partially unusable.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/KeyConfigDlg.cpp
trunk/OpenMPT/mptrack/View_smp.cpp
Modified: trunk/OpenMPT/mptrack/KeyConfigDlg.cpp
===================================================================
--- trunk/OpenMPT/mptrack/KeyConfigDlg.cpp 2015-01-23 19:13:33 UTC (rev 4730)
+++ trunk/OpenMPT/mptrack/KeyConfigDlg.cpp 2015-01-23 22:47:51 UTC (rev 4731)
@@ -773,7 +773,7 @@
if((conflictCmd = plocalCmdSet->IsConflicting(kc, cmd)).first != kcNull
&& conflictCmd.first != cmd
&& !plocalCmdSet->IsCrossContextConflict(kc, conflictCmd.second)
- && Reporting::Confirm("New shortcut (" + kc.GetKeyText() + ") conflicts with " + plocalCmdSet->GetCommandText(conflictCmd.first) + " in " + conflictCmd.second.GetContextText() + ".\nDelete the other shortcut and keep the new one?", "Shortcut Conflict") == cnfNo)
+ && Reporting::Confirm("New shortcut (" + kc.GetKeyText() + ") conflicts with " + plocalCmdSet->GetCommandText(conflictCmd.first) + " in " + conflictCmd.second.GetContextText() + ".\nDelete the other shortcut and keep the new one?", "Shortcut Conflict", false, this) == cnfNo)
{
// Restore original choice
add = false;
Modified: trunk/OpenMPT/mptrack/View_smp.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_smp.cpp 2015-01-23 19:13:33 UTC (rev 4730)
+++ trunk/OpenMPT/mptrack/View_smp.cpp 2015-01-23 22:47:51 UTC (rev 4731)
@@ -2932,7 +2932,6 @@
case kcSampleCenterLoopEnd:
case kcSampleCenterSustainStart:
case kcSampleCenterSustainEnd:
- if(m_nZoom)
{
SmpLength point = 0;
ModSample &sample = sndFile.GetSample(m_nSample);
@@ -2943,7 +2942,10 @@
case kcSampleCenterSustainStart: point = sample.nSustainStart; break;
case kcSampleCenterSustainEnd: point = sample.nSustainEnd; break;
}
- ScrollToSample(point);
+ if(!m_nZoom)
+ SetZoom(1, point);
+ else
+ ScrollToSample(point);
}
return wParam;
case kcPrevInstrument: OnPrevInstrument(); return wParam;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2015-02-21 17:40:05
|
Revision: 4779
http://sourceforge.net/p/modplug/code/4779
Author: saga-games
Date: 2015-02-21 17:39:59 +0000 (Sat, 21 Feb 2015)
Log Message:
-----------
[Fix] The bold and italic styles were ignored on custom pattern / comments fonts.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/TrackerSettings.cpp
trunk/OpenMPT/mptrack/TrackerSettings.h
Modified: trunk/OpenMPT/mptrack/TrackerSettings.cpp
===================================================================
--- trunk/OpenMPT/mptrack/TrackerSettings.cpp 2015-02-21 01:11:38 UTC (rev 4778)
+++ trunk/OpenMPT/mptrack/TrackerSettings.cpp 2015-02-21 17:39:59 UTC (rev 4779)
@@ -544,14 +544,8 @@
}
if(storedVersion < MAKE_VERSION_NUMERIC(1,24,01,04))
{
- if(m_dwPatternSetup & 0x02)
- commentsFont = FontSetting("Courier New", 120);
- else
- commentsFont = FontSetting("Courier New", 90);
- if(m_dwPatternSetup & 0x08)
- patternFont = FontSetting(PATTERNFONT_SMALL, 0);
- else
- patternFont = FontSetting(PATTERNFONT_LARGE, 0);
+ commentsFont = FontSetting("Courier New", (m_dwPatternSetup & 0x02) ? 120 : 90);
+ patternFont = FontSetting((m_dwPatternSetup & 0x08) ? PATTERNFONT_SMALL : PATTERNFONT_LARGE, 0);
m_dwPatternSetup &= ~(0x08 | 0x02);
}
Modified: trunk/OpenMPT/mptrack/TrackerSettings.h
===================================================================
--- trunk/OpenMPT/mptrack/TrackerSettings.h 2015-02-21 01:11:38 UTC (rev 4778)
+++ trunk/OpenMPT/mptrack/TrackerSettings.h 2015-02-21 17:39:59 UTC (rev 4779)
@@ -341,6 +341,7 @@
int32_t size;
FlagSet<FontFlags> flags;
+ FontSetting(const FontSetting &other) : name(other.name), size(other.size), flags(other.flags) { }
FontSetting(const std::string &name = "", int32_t size = 120, FontFlags flags = None) : name(name), size(size), flags(flags) { }
bool operator== (const FontSetting &other) const
@@ -367,7 +368,7 @@
if(sizeStart != std::string::npos)
{
setting.size = atoi(&setting.name[sizeStart + 1]);
- size_t flagsStart = setting.name.find(' ', sizeStart + 1);
+ size_t flagsStart = setting.name.find('|', sizeStart + 1);
if(flagsStart != std::string::npos)
{
setting.flags = static_cast<FontSetting::FontFlags>(atoi(&setting.name[flagsStart + 1]));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2015-02-24 22:32:30
|
Revision: 4791
http://sourceforge.net/p/modplug/code/4791
Author: saga-games
Date: 2015-02-24 22:32:25 +0000 (Tue, 24 Feb 2015)
Log Message:
-----------
[Fix] Sample tab: Entering a finetune amount or middle-C frequency created an undo step for every entered digit.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Ctrl_smp.cpp
trunk/OpenMPT/mptrack/Ctrl_smp.h
Modified: trunk/OpenMPT/mptrack/Ctrl_smp.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2015-02-24 21:24:29 UTC (rev 4790)
+++ trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2015-02-24 22:32:25 UTC (rev 4791)
@@ -33,7 +33,7 @@
#include "FileDialog.h"
#include "../common/ComponentManager.h"
#ifdef _DEBUG
-#include <math.h>
+#include <cmath>
#endif
#include "../include/r8brain/CDSPResampler.h"
@@ -49,19 +49,15 @@
// Round floating point value to "digit" number of digits
static float Round(const float value, const int digit)
{
- float v = 0.1f * (value * powf(10.0f, (float)(digit + 1)) + (value < 0.0f ? -5.0f : 5.0f));
- modff(v, &v);
- return v / powf(10.0f, (float)digit);
+ float v = 0.1f * (value * std::pow(10.0f, (float)(digit + 1)) + (value < 0.0f ? -5.0f : 5.0f));
+ std::modf(v, &v);
+ return v / std::pow(10.0f, (float)digit);
}
-template<int v>
-static int PowerOf2Exponent()
-{
- if(v <= 1)
- return 0;
- else
- return 1 + PowerOf2Exponent<v / 2>();
-}
+template<unsigned int v>
+struct PowerOf2Exponent { enum { value = 1 + PowerOf2Exponent<v / 2>::value }; };
+template<>
+struct PowerOf2Exponent<1> { enum { value = 0 }; };
#define BASENOTE_MIN (1*12) // C-1
@@ -199,6 +195,7 @@
{
CModControlDlg::OnInitDialog();
m_bInitialized = FALSE;
+ finetuneBoxActive = false;
SetRedraw(FALSE);
// Zoom Selection
@@ -299,7 +296,7 @@
if(combo)
{
// Deduce exponent from equation : MAX_FRAME_LENGTH = 2^exponent
- const int exponent = PowerOf2Exponent<MAX_FRAME_LENGTH>();
+ const int exponent = PowerOf2Exponent<MAX_FRAME_LENGTH>::value;
// Allow FFT size from 2^8 (256) to 2^exponent (MAX_FRAME_LENGTH)
for(int i = 8 ; i <= exponent ; i++)
{
@@ -337,7 +334,7 @@
if (m_nSample != nSmp)
{
m_nSample = nSmp;
- UpdateView(SampleHint(m_nSample).Info(), NULL);
+ UpdateView(SampleHint(m_nSample).Info());
}
if (bUpdNum)
{
@@ -2479,7 +2476,11 @@
{
if (IsLocked()) return;
int n = GetDlgItemInt(IDC_EDIT5);
- m_modDoc.GetSampleUndo().PrepareUndo(m_nSample, sundo_none, "Finetune");
+ if(!finetuneBoxActive)
+ {
+ m_modDoc.GetSampleUndo().PrepareUndo(m_nSample, sundo_none, "Finetune");
+ finetuneBoxActive = true;
+ }
ModSample &sample = m_sndFile.GetSample(m_nSample);
if (m_sndFile.m_nType & (MOD_TYPE_IT|MOD_TYPE_S3M|MOD_TYPE_MPT))
{
@@ -2514,6 +2515,7 @@
void CCtrlSamples::OnFineTuneChangedDone()
//----------------------------------------
{
+ finetuneBoxActive = false;
// Update all playing channels
ModSample &sample = m_sndFile.GetSample(m_nSample);
for(CHANNELINDEX i = 0; i < MAX_CHANNELS; i++)
@@ -3236,8 +3238,8 @@
// When changing auto vibrato properties, propagate them to other samples of the same instrument in XM edit mode.
-void CCtrlSamples::PropagateAutoVibratoChanges() const
-//----------------------------------------------------
+void CCtrlSamples::PropagateAutoVibratoChanges()
+//----------------------------------------------
{
if(!(m_sndFile.GetType() & MOD_TYPE_XM))
{
@@ -3259,7 +3261,7 @@
m_sndFile.GetSample(*sample).nVibType = m_sndFile.GetSample(m_nSample).nVibType;
m_sndFile.GetSample(*sample).nVibRate = m_sndFile.GetSample(m_nSample).nVibRate;
m_sndFile.GetSample(*sample).nVibSweep = m_sndFile.GetSample(m_nSample).nVibSweep;
- m_modDoc.UpdateAllViews(nullptr, SampleHint(*sample).Info(), (CObject *)this);
+ m_modDoc.UpdateAllViews(nullptr, SampleHint(*sample).Info(), this);
}
}
}
Modified: trunk/OpenMPT/mptrack/Ctrl_smp.h
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_smp.h 2015-02-24 21:24:29 UTC (rev 4790)
+++ trunk/OpenMPT/mptrack/Ctrl_smp.h 2015-02-24 22:32:25 UTC (rev 4791)
@@ -43,7 +43,8 @@
uint32 m_nSeekWindowMs;
uint32 m_nOverlapMs;
SampleIO m_nPreviousRawFormat;
- bool rememberRawFormat;
+ bool finetuneBoxActive : 1;
+ bool rememberRawFormat : 1;
CComboBox m_ComboPitch, m_ComboQuality, m_ComboFFT;
@@ -60,7 +61,7 @@
SampleSelectionPoints GetSelectionPoints();
void SetSelectionPoints(SmpLength nStart, SmpLength nEnd);
- void PropagateAutoVibratoChanges() const;
+ void PropagateAutoVibratoChanges();
public:
CCtrlSamples(CModControlView &parent, CModDoc &document);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2015-02-26 23:11:23
|
Revision: 4793
http://sourceforge.net/p/modplug/code/4793
Author: saga-games
Date: 2015-02-26 23:11:17 +0000 (Thu, 26 Feb 2015)
Log Message:
-----------
[Fix] General tab: The "Set" button for updating plugin parameters was still present by accident. Clicking the button could lead to problems with descriptive parameter values.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/View_gen.cpp
trunk/OpenMPT/mptrack/mptrack.rc
Modified: trunk/OpenMPT/mptrack/View_gen.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_gen.cpp 2015-02-24 23:49:37 UTC (rev 4792)
+++ trunk/OpenMPT/mptrack/View_gen.cpp 2015-02-26 23:11:17 UTC (rev 4793)
@@ -77,7 +77,6 @@
ON_COMMAND(IDC_CHECK11, OnDryMixChanged)
ON_COMMAND(IDC_BUTTON1, OnSelectPlugin)
ON_COMMAND(IDC_BUTTON2, OnEditPlugin)
- ON_COMMAND(IDC_BUTTON3, OnSetParameter)
ON_COMMAND(IDC_BUTTON4, OnNextPlugin)
ON_COMMAND(IDC_BUTTON5, OnPrevPlugin)
ON_COMMAND(IDC_MOVEFXSLOT, OnMovePlugToSlot)
Modified: trunk/OpenMPT/mptrack/mptrack.rc
===================================================================
--- trunk/OpenMPT/mptrack/mptrack.rc 2015-02-24 23:49:37 UTC (rev 4792)
+++ trunk/OpenMPT/mptrack/mptrack.rc 2015-02-26 23:11:17 UTC (rev 4793)
@@ -1217,8 +1217,7 @@
CTEXT "Parameter",IDC_STATIC,16,266,43,13,SS_CENTERIMAGE,WS_EX_STATICEDGE
COMBOBOX IDC_COMBO6,61,266,122,162,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "ValSld",IDC_SLIDER9,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,16,283,102,14,WS_EX_STATICEDGE
- EDITTEXT IDC_EDIT14,121,283,39,14,ES_AUTOHSCROLL
- PUSHBUTTON "Set",IDC_BUTTON3,163,283,20,14,0,WS_EX_STATICEDGE
+ EDITTEXT IDC_EDIT14,121,283,62,14,ES_AUTOHSCROLL
GROUPBOX "Mix Settings",IDC_STATIC,193,226,214,78
CONTROL "Master",IDC_CHECK9,"Button",BS_AUTOCHECKBOX | BS_FLAT | WS_TABSTOP,199,242,46,10
CTEXT "Mix Mode",IDC_STATIC,245,241,37,13,SS_CENTERIMAGE,WS_EX_STATICEDGE
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <man...@us...> - 2015-03-03 22:41:48
|
Revision: 4817
http://sourceforge.net/p/modplug/code/4817
Author: manxorist
Date: 2015-03-03 22:41:35 +0000 (Tue, 03 Mar 2015)
Log Message:
-----------
[Ref] Silence another charset conversion warning.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/TuningDialog.cpp
trunk/OpenMPT/mptrack/TuningDialog.h
Modified: trunk/OpenMPT/mptrack/TuningDialog.cpp
===================================================================
--- trunk/OpenMPT/mptrack/TuningDialog.cpp 2015-03-03 20:57:40 UTC (rev 4816)
+++ trunk/OpenMPT/mptrack/TuningDialog.cpp 2015-03-03 22:41:35 UTC (rev 4817)
@@ -731,7 +731,7 @@
}
} else // scl import.
{
- EnSclImport a = ImportScl(files[counter], fileName.ToCString());
+ EnSclImport a = ImportScl(files[counter], fileName.ToUnicode());
if (a != enSclImportOk)
{
if (a == enSclImportAddTuningFailure && m_TempTunings.GetNumTunings() >= CTuningCollection::s_nMaxTuningCount)
@@ -1466,20 +1466,20 @@
}
-CTuningDialog::EnSclImport CTuningDialog::ImportScl(const mpt::PathString &filename, LPCTSTR pszName)
-//---------------------------------------------------------------------------------------------------
+CTuningDialog::EnSclImport CTuningDialog::ImportScl(const mpt::PathString &filename, const mpt::ustring &name)
+//------------------------------------------------------------------------------------------------------------
{
mpt::ifstream iStrm(filename, std::ios::in | std::ios::binary);
if(!iStrm)
{
return enSclImportFailUnableToOpenFile;
}
- return ImportScl(iStrm, pszName);
+ return ImportScl(iStrm, name);
}
-CTuningDialog::EnSclImport CTuningDialog::ImportScl(std::istream& iStrm, LPCTSTR pszName)
-//---------------------------------------------------------------------------------------
+CTuningDialog::EnSclImport CTuningDialog::ImportScl(std::istream& iStrm, const mpt::ustring &name)
+//------------------------------------------------------------------------------------------------
{
std::string str;
SkipCommentLines(iStrm, str);
@@ -1564,7 +1564,7 @@
return enSclImportAddTuningFailure;
}
- pT->SetName(pszName);
+ pT->SetName(mpt::ToLocale(name));
return enSclImportOk;
}
Modified: trunk/OpenMPT/mptrack/TuningDialog.h
===================================================================
--- trunk/OpenMPT/mptrack/TuningDialog.h 2015-03-03 20:57:40 UTC (rev 4816)
+++ trunk/OpenMPT/mptrack/TuningDialog.h 2015-03-03 22:41:35 UTC (rev 4817)
@@ -257,8 +257,8 @@
bool IsDeletable(const CTuningCollection* const pTC) const;
// Scl-file import.
- EnSclImport ImportScl(const mpt::PathString &filename, LPCTSTR pszName);
- EnSclImport ImportScl(std::istream& iStrm, LPCTSTR pszName);
+ EnSclImport ImportScl(const mpt::PathString &filename, const mpt::ustring &name);
+ EnSclImport ImportScl(std::istream& iStrm, const mpt::ustring &name);
private:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <man...@us...> - 2015-03-04 14:43:04
|
Revision: 4824
http://sourceforge.net/p/modplug/code/4824
Author: manxorist
Date: 2015-03-04 14:42:51 +0000 (Wed, 04 Mar 2015)
Log Message:
-----------
[Fix] Stream Export: Cleanup a couple of 64bit warnings.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/StreamEncoderFLAC.cpp
trunk/OpenMPT/mptrack/StreamEncoderMP3.cpp
trunk/OpenMPT/mptrack/StreamEncoderOpus.cpp
trunk/OpenMPT/mptrack/StreamEncoderVorbis.cpp
Modified: trunk/OpenMPT/mptrack/StreamEncoderFLAC.cpp
===================================================================
--- trunk/OpenMPT/mptrack/StreamEncoderFLAC.cpp 2015-03-04 13:50:05 UTC (rev 4823)
+++ trunk/OpenMPT/mptrack/StreamEncoderFLAC.cpp 2015-03-04 14:42:51 UTC (rev 4824)
@@ -239,7 +239,12 @@
}
break;
}
- FLAC__stream_encoder_process_interleaved(encoder, &sampleBuf[0], frameCount);
+ while(frameCount > 0)
+ {
+ unsigned int frameCountChunk = mpt::saturate_cast<unsigned int>(frameCount);
+ FLAC__stream_encoder_process_interleaved(encoder, &sampleBuf[0], frameCountChunk);
+ frameCount -= frameCountChunk;
+ }
}
virtual void Finalize()
{
Modified: trunk/OpenMPT/mptrack/StreamEncoderMP3.cpp
===================================================================
--- trunk/OpenMPT/mptrack/StreamEncoderMP3.cpp 2015-03-04 13:50:05 UTC (rev 4823)
+++ trunk/OpenMPT/mptrack/StreamEncoderMP3.cpp 2015-03-04 14:42:51 UTC (rev 4824)
@@ -872,7 +872,7 @@
}
DWORD size = 0;
buf.resize(blade_outputbytes);
- blade.beEncodeChunk(bestream, samples.size(), &samples[0], (PBYTE)&buf[0], &size);
+ blade.beEncodeChunk(bestream, static_cast<DWORD>(samples.size()), &samples[0], (PBYTE)&buf[0], &size);
ASSERT(size <= buf.size());
buf.resize(size);
WriteBuffer();
@@ -891,7 +891,7 @@
blade_sampleBuf.clear();
DWORD size = 0;
buf.resize(blade_outputbytes);
- blade.beEncodeChunk(bestream, samples.size(), &samples[0], (PBYTE)&buf[0], &size);
+ blade.beEncodeChunk(bestream, static_cast<DWORD>(samples.size()), &samples[0], (PBYTE)&buf[0], &size);
ASSERT(size <= buf.size());
buf.resize(size);
WriteBuffer();
@@ -1366,9 +1366,9 @@
acm_sampleBuf.pop_front();
}
std::memcpy(&acmSrcBuf[0], &samples[0], acmSrcBuf.size());
- acmHeader.cbSrcLength = acmSrcBuf.size();
+ acmHeader.cbSrcLength = static_cast<DWORD>(acmSrcBuf.size());
acmHeader.cbSrcLengthUsed = 0;
- acmHeader.cbDstLength = acmDstBuf.size();
+ acmHeader.cbDstLength = static_cast<DWORD>(acmDstBuf.size());
acmHeader.cbDstLengthUsed = 0;
acmStreamConvert(acmStream, &acmHeader, ACM_STREAMCONVERTF_BLOCKALIGN);
if(acmHeader.cbDstLengthUsed)
@@ -1405,9 +1405,9 @@
}
std::memcpy(&acmSrcBuf[0], &samples[0], samples.size() * sizeof(int16));
}
- acmHeader.cbSrcLength = samples.size() * sizeof(int16);
+ acmHeader.cbSrcLength = static_cast<DWORD>(samples.size() * sizeof(int16));
acmHeader.cbSrcLengthUsed = 0;
- acmHeader.cbDstLength = acmDstBuf.size();
+ acmHeader.cbDstLength = static_cast<DWORD>(acmDstBuf.size());
acmHeader.cbDstLengthUsed = 0;
acmStreamConvert(acmStream, &acmHeader, ACM_STREAMCONVERTF_END);
if(acmHeader.cbDstLengthUsed)
Modified: trunk/OpenMPT/mptrack/StreamEncoderOpus.cpp
===================================================================
--- trunk/OpenMPT/mptrack/StreamEncoderOpus.cpp 2015-03-04 13:50:05 UTC (rev 4823)
+++ trunk/OpenMPT/mptrack/StreamEncoderOpus.cpp 2015-03-04 14:42:51 UTC (rev 4824)
@@ -233,7 +233,7 @@
const char *version_string = opus.opus_get_version_string ? opus.opus_get_version_string() : nullptr;
if(version_string)
{
- PushUint32LE(opus_comments_buf, std::strlen(version_string));
+ PushUint32LE(opus_comments_buf, mpt::saturate_cast<uint32>(std::strlen(version_string)));
for(/*nothing*/; *version_string; ++version_string)
{
opus_comments_buf.push_back(*version_string);
@@ -242,17 +242,17 @@
{
PushUint32LE(opus_comments_buf, 0);
}
- PushUint32LE(opus_comments_buf, opus_comments.size());
+ PushUint32LE(opus_comments_buf, mpt::saturate_cast<uint32>(opus_comments.size()));
for(std::vector<std::string>::const_iterator it = opus_comments.begin(); it != opus_comments.end(); ++it)
{
- PushUint32LE(opus_comments_buf, it->length());
+ PushUint32LE(opus_comments_buf, mpt::saturate_cast<uint32>(it->length()));
for(std::size_t i = 0; i < it->length(); ++i)
{
opus_comments_buf.push_back((*it)[i]);
}
}
op.packet = &opus_comments_buf[0];
- op.bytes = opus_comments_buf.size();
+ op.bytes = mpt::saturate_cast<long>(opus_comments_buf.size());
op.b_o_s = 0;
op.e_o_s = 0;
op.granulepos = 0;
@@ -284,7 +284,7 @@
WriteInterleaved(opus_extrasamples, &extraBuf[0]);
int cur_frame_size = 960 * opus_samplerate / 48000;
- int last_frame_size = (opus_sampleBuf.size() / opus_channels) * opus_samplerate / 48000;
+ int last_frame_size = (static_cast<int>(opus_sampleBuf.size()) / opus_channels) * opus_samplerate / 48000;
opus_frameBuf.resize(opus_channels * cur_frame_size);
for(size_t sample = 0; sample < opus_frameBuf.size(); ++sample)
@@ -299,7 +299,7 @@
opus_sampleBuf.clear();
opus_frameData.resize(65536);
- opus_frameData.resize(opus.opus_multistream_encode_float(st, &opus_frameBuf[0], cur_frame_size, &opus_frameData[0], opus_frameData.size()));
+ opus_frameData.resize(opus.opus_multistream_encode_float(st, &opus_frameBuf[0], cur_frame_size, &opus_frameData[0], static_cast<opus_int32>(opus_frameData.size())));
enc_granulepos += last_frame_size * 48000 / opus_samplerate;
op.b_o_s = 0;
@@ -307,7 +307,7 @@
op.granulepos = enc_granulepos;
op.packetno = packetno;
op.packet = &opus_frameData[0];
- op.bytes = opus_frameData.size();
+ op.bytes = static_cast<long>(opus_frameData.size());
opus.ogg_stream_packetin(&os, &op);
packetno++;
@@ -535,7 +535,7 @@
}
opus_frameData.resize(65536);
- opus_frameData.resize(opus.opus_multistream_encode_float(st, &opus_frameBuf[0], cur_frame_size, &opus_frameData[0], opus_frameData.size()));
+ opus_frameData.resize(opus.opus_multistream_encode_float(st, &opus_frameBuf[0], cur_frame_size, &opus_frameData[0], static_cast<opus_int32>(opus_frameData.size())));
enc_granulepos += cur_frame_size * 48000 / opus_samplerate;
op.b_o_s = 0;
@@ -543,7 +543,7 @@
op.granulepos = enc_granulepos;
op.packetno = packetno;
op.packet = &opus_frameData[0];
- op.bytes = opus_frameData.size();
+ op.bytes = static_cast<long>(opus_frameData.size());
opus.ogg_stream_packetin(&os, &op);
packetno++;
Modified: trunk/OpenMPT/mptrack/StreamEncoderVorbis.cpp
===================================================================
--- trunk/OpenMPT/mptrack/StreamEncoderVorbis.cpp 2015-03-04 13:50:05 UTC (rev 4823)
+++ trunk/OpenMPT/mptrack/StreamEncoderVorbis.cpp 2015-03-04 14:42:51 UTC (rev 4824)
@@ -361,29 +361,35 @@
StartStream();
}
ASSERT(inited && started);
- float **buffer = vorbis.vorbis_analysis_buffer(&vd, count);
- for(size_t frame = 0; frame < count; ++frame)
+ size_t countTotal = count;
+ while(countTotal > 0)
{
- for(int channel = 0; channel < vorbis_channels; ++channel)
+ int countChunk = mpt::saturate_cast<int>(countTotal);
+ countTotal -= countChunk;
+ float **buffer = vorbis.vorbis_analysis_buffer(&vd, countChunk);
+ for(int frame = 0; frame < countChunk; ++frame)
{
- buffer[channel][frame] = interleaved[frame*vorbis_channels+channel];
+ for(int channel = 0; channel < vorbis_channels; ++channel)
+ {
+ buffer[channel][frame] = interleaved[frame*vorbis_channels+channel];
+ }
}
- }
- vorbis.vorbis_analysis_wrote(&vd, count);
- while(vorbis.vorbis_analysis_blockout(&vd, &vb) == 1)
- {
- vorbis.vorbis_analysis(&vb, NULL);
- vorbis.vorbis_bitrate_addblock(&vb);
- while(vorbis.vorbis_bitrate_flushpacket(&vd, &op))
+ vorbis.vorbis_analysis_wrote(&vd, countChunk);
+ while(vorbis.vorbis_analysis_blockout(&vd, &vb) == 1)
{
- vorbis.ogg_stream_packetin(&os, &op);
- while(true)
+ vorbis.vorbis_analysis(&vb, NULL);
+ vorbis.vorbis_bitrate_addblock(&vb);
+ while(vorbis.vorbis_bitrate_flushpacket(&vd, &op))
{
- int gotPage = vorbis.ogg_stream_pageout(&os, &og);
- if(!gotPage) break;
- WritePage();
+ vorbis.ogg_stream_packetin(&os, &op);
+ while(true)
+ {
+ int gotPage = vorbis.ogg_stream_pageout(&os, &og);
+ if(!gotPage) break;
+ WritePage();
+ }
}
- }
+ }
}
}
virtual void Finalize()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2015-03-04 18:02:10
|
Revision: 4827
http://sourceforge.net/p/modplug/code/4827
Author: saga-games
Date: 2015-03-04 18:02:04 +0000 (Wed, 04 Mar 2015)
Log Message:
-----------
[Ref] Explicitely use CStringA in the pattern clipboard code
Modified Paths:
--------------
trunk/OpenMPT/mptrack/PatternClipboard.cpp
trunk/OpenMPT/mptrack/PatternClipboard.h
Modified: trunk/OpenMPT/mptrack/PatternClipboard.cpp
===================================================================
--- trunk/OpenMPT/mptrack/PatternClipboard.cpp 2015-03-04 17:25:38 UTC (rev 4826)
+++ trunk/OpenMPT/mptrack/PatternClipboard.cpp 2015-03-04 18:02:04 UTC (rev 4827)
@@ -36,10 +36,10 @@
PatternClipboard PatternClipboard::instance;
-CString PatternClipboard::GetFileExtension(const char *ext)
-//---------------------------------------------------------
+CStringA PatternClipboard::GetFileExtension(const char *ext)
+//----------------------------------------------------------
{
- CString format(ext);
+ CStringA format(ext);
if(format.GetLength() > 3)
{
format.Truncate(3);
@@ -61,8 +61,8 @@
LimitMax(last, sndFile.Order.GetLength());
// Set up clipboard header.
- CString data = "ModPlug Tracker " + GetFileExtension(sndFile.GetModSpecifications().fileExtension) + "\r\nOrders: ";
- CString patternData;
+ CStringA data = "ModPlug Tracker " + GetFileExtension(sndFile.GetModSpecifications().fileExtension) + "\r\nOrders: ";
+ CStringA patternData;
// Pattern => Order list assignment
std::vector<PATTERNINDEX> patList(sndFile.Patterns.Size(), PATTERNINDEX_INVALID);
@@ -91,7 +91,7 @@
patList[pattern] = insertedPats++;
patternData.AppendFormat("Rows: %u\r\n", sndFile.Patterns[pattern].GetNumRows());
- CString name = sndFile.Patterns[pattern].GetName().c_str();
+ CStringA name = sndFile.Patterns[pattern].GetName().c_str();
if(!name.IsEmpty())
{
patternData.Append("Name: " + name + "\r\n");
@@ -111,7 +111,7 @@
if(instance.activeClipboard < instance.clipboards.size())
{
// Copy to internal clipboard
- CString desc;
+ CStringA desc;
desc.Format("%u Patterns (%u to %u)", last - first + 1, first, last);
instance.clipboards[instance.activeClipboard] = PatternClipboardElement(data, desc);
}
@@ -124,7 +124,7 @@
bool PatternClipboard::Copy(CSoundFile &sndFile, PATTERNINDEX pattern, PatternRect selection)
//-------------------------------------------------------------------------------------------
{
- CString data = CreateClipboardString(sndFile, pattern, selection);
+ CStringA data = CreateClipboardString(sndFile, pattern, selection);
if(data.IsEmpty())
{
return false;
@@ -136,7 +136,7 @@
if(instance.activeClipboard < instance.clipboards.size())
{
// Copy to internal clipboard
- CString desc;
+ CStringA desc;
desc.Format("%u rows, %u channels (pattern %u)", selection.GetNumRows(), selection.GetNumChannels(), pattern);
instance.clipboards[instance.activeClipboard] = PatternClipboardElement(data, desc);
}
@@ -146,8 +146,8 @@
// Create the clipboard text for a pattern selection
-CString PatternClipboard::CreateClipboardString(CSoundFile &sndFile, PATTERNINDEX pattern, PatternRect selection)
-//---------------------------------------------------------------------------------------------------------------
+CStringA PatternClipboard::CreateClipboardString(CSoundFile &sndFile, PATTERNINDEX pattern, PatternRect selection)
+//----------------------------------------------------------------------------------------------------------------
{
if(!sndFile.Patterns.IsValidPat(pattern))
{
@@ -165,7 +165,7 @@
const ROWINDEX startRow = selection.GetStartRow(), numRows = selection.GetNumRows();
const CHANNELINDEX startChan = selection.GetStartChannel(), numChans = selection.GetNumChannels();
- CString data;
+ CStringA data;
data.Preallocate(numRows * (numChans * 12 + 2));
for(ROWINDEX row = 0; row < numRows; row++)
@@ -277,7 +277,7 @@
bool PatternClipboard::Paste(CSoundFile &sndFile, ModCommandPos &pastePos, PasteModes mode, ORDERINDEX curOrder, PatternRect &pasteRect)
//--------------------------------------------------------------------------------------------------------------------------------------
{
- CString data;
+ CStringA data;
if(!FromSystemClipboard(data) || !HandlePaste(sndFile, pastePos, mode, data, curOrder, pasteRect))
{
// Fall back to internal clipboard if there's no valid pattern data in the system clipboard.
@@ -300,8 +300,8 @@
// Parse clipboard string and perform the pasting operation.
-bool PatternClipboard::HandlePaste(CSoundFile &sndFile, ModCommandPos &pastePos, PasteModes mode, const CString &data, ORDERINDEX curOrder, PatternRect &pasteRect)
-//-----------------------------------------------------------------------------------------------------------------------------------------------------------------
+bool PatternClipboard::HandlePaste(CSoundFile &sndFile, ModCommandPos &pastePos, PasteModes mode, const CStringA &data, ORDERINDEX curOrder, PatternRect &pasteRect)
+//------------------------------------------------------------------------------------------------------------------------------------------------------------------
{
PATTERNINDEX pattern = pastePos.pattern;
if(sndFile.GetpModDoc() == nullptr)
@@ -324,11 +324,11 @@
{
startPos += 16;
// Check paste format
- const CString format = data.Mid(startPos, 3);
+ const CStringA format = data.Mid(startPos, 3);
for(size_t i = 0; i < CountOf(ModSpecs::Collection); i++)
{
- const CString ext = GetFileExtension(ModSpecs::Collection[i]->fileExtension);
+ const CStringA ext = GetFileExtension(ModSpecs::Collection[i]->fileExtension);
if(format == ext)
{
pasteFormat = ModSpecs::Collection[i]->internalType;
@@ -856,8 +856,8 @@
// System-specific clipboard functions
-bool PatternClipboard::ToSystemClipboard(const CString &data)
-//-----------------------------------------------------------
+bool PatternClipboard::ToSystemClipboard(const CStringA &data)
+//------------------------------------------------------------
{
CMainFrame *mainFrame = CMainFrame::GetMainFrame();
if(mainFrame == nullptr || !mainFrame->OpenClipboard())
@@ -889,8 +889,8 @@
// System-specific clipboard functions
-bool PatternClipboard::FromSystemClipboard(CString &data)
-//-------------------------------------------------------
+bool PatternClipboard::FromSystemClipboard(CStringA &data)
+//--------------------------------------------------------
{
CMainFrame *mainFrame = CMainFrame::GetMainFrame();
if(mainFrame == nullptr || !mainFrame->OpenClipboard())
@@ -1084,7 +1084,7 @@
return;
}
- CString newName;
+ CStringA newName;
editNameBox.GetWindowText(newName);
PatternClipboard::instance.clipboards[sel].description = newName;
Modified: trunk/OpenMPT/mptrack/PatternClipboard.h
===================================================================
--- trunk/OpenMPT/mptrack/PatternClipboard.h 2015-03-04 17:25:38 UTC (rev 4826)
+++ trunk/OpenMPT/mptrack/PatternClipboard.h 2015-03-04 18:02:04 UTC (rev 4827)
@@ -24,13 +24,13 @@
{
public:
- CString content;
- CString description;
+ CStringA content;
+ CStringA description;
public:
PatternClipboardElement() { };
- PatternClipboardElement(const CString &data, const CString &desc) : content(data), description(desc) { };
+ PatternClipboardElement(const CStringA &data, const CStringA &desc) : content(data), description(desc) { };
};
@@ -91,18 +91,18 @@
PatternClipboard() : activeClipboard(0) { SetClipboardSize(1); };
- static CString GetFileExtension(const char *ext);
+ static CStringA GetFileExtension(const char *ext);
// Create the clipboard text for a pattern selection
- static CString CreateClipboardString(CSoundFile &sndFile, PATTERNINDEX pattern, PatternRect selection);
+ static CStringA CreateClipboardString(CSoundFile &sndFile, PATTERNINDEX pattern, PatternRect selection);
// Parse clipboard string and perform the pasting operation.
- static bool HandlePaste(CSoundFile &sndFile, ModCommandPos &pastePos, PasteModes mode, const CString &data, ORDERINDEX curOrder, PatternRect &pasteRect);
+ static bool HandlePaste(CSoundFile &sndFile, ModCommandPos &pastePos, PasteModes mode, const CStringA &data, ORDERINDEX curOrder, PatternRect &pasteRect);
// System-specific clipboard functions
static bool ToSystemClipboard(const PatternClipboardElement &clipboard) { return ToSystemClipboard(clipboard.content); };
- static bool ToSystemClipboard(const CString &data);
- static bool FromSystemClipboard(CString &data);
+ static bool ToSystemClipboard(const CStringA &data);
+ static bool FromSystemClipboard(CStringA &data);
};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <man...@us...> - 2015-03-04 18:04:32
|
Revision: 4828
http://sourceforge.net/p/modplug/code/4828
Author: manxorist
Date: 2015-03-04 18:04:26 +0000 (Wed, 04 Mar 2015)
Log Message:
-----------
[Ref] Assorted 64bit warnings fixes.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Moptions.cpp
trunk/OpenMPT/mptrack/Mptrack.cpp
trunk/OpenMPT/mptrack/TrackerSettings.cpp
Modified: trunk/OpenMPT/mptrack/Moptions.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Moptions.cpp 2015-03-04 18:02:04 UTC (rev 4827)
+++ trunk/OpenMPT/mptrack/Moptions.cpp 2015-03-04 18:04:26 UTC (rev 4828)
@@ -463,7 +463,7 @@
int sel = m_ComboItem.GetCurSel();
if (sel >= 0)
{
- m_nColorItem = m_ComboItem.GetItemData(sel);
+ m_nColorItem = static_cast<uint32>(m_ComboItem.GetItemData(sel));
OnUpdateDialog();
}
}
@@ -743,7 +743,7 @@
{
CPropertyPage::OnInitDialog();
- for(size_t i = 0; i < CountOf(generalOptionsList); i++)
+ for(int i = 0; i < CountOf(generalOptionsList); i++)
{
m_CheckList.AddString(generalOptionsList[i].name);
const int check = (TrackerSettings::Instance().m_dwPatternSetup & generalOptionsList[i].flag) != 0 ? BST_CHECKED : BST_UNCHECKED;
@@ -774,7 +774,7 @@
::GetDlgItemTextW(m_hWnd, IDC_OPTIONS_DIR_VSTS, szVstDir, MAX_PATH);
::GetDlgItemTextW(m_hWnd, IDC_OPTIONS_DIR_VSTPRESETS, szPresetDir, MAX_PATH);
- for(size_t i = 0; i < CountOf(generalOptionsList); i++)
+ for(int i = 0; i < CountOf(generalOptionsList); i++)
{
const bool check = (m_CheckList.GetCheck(i) != BST_UNCHECKED);
Modified: trunk/OpenMPT/mptrack/Mptrack.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Mptrack.cpp 2015-03-04 18:02:04 UTC (rev 4827)
+++ trunk/OpenMPT/mptrack/Mptrack.cpp 2015-03-04 18:04:26 UTC (rev 4828)
@@ -214,7 +214,7 @@
if ((lpszCommand) && (*lpszCommand) && (theApp.m_pMainWnd))
{
CHAR s[_MAX_PATH], *pszCmd, *pszData;
- int len;
+ std::size_t len;
mpt::String::CopyN(s, lpszCommand);
len = strlen(s) - 1;
Modified: trunk/OpenMPT/mptrack/TrackerSettings.cpp
===================================================================
--- trunk/OpenMPT/mptrack/TrackerSettings.cpp 2015-03-04 18:02:04 UTC (rev 4827)
+++ trunk/OpenMPT/mptrack/TrackerSettings.cpp 2015-03-04 18:04:26 UTC (rev 4828)
@@ -329,7 +329,7 @@
// load old and messy stuff:
- PatternClipboard::SetClipboardSize(conf.Read<int32>("Pattern Editor", "NumClipboards", PatternClipboard::GetClipboardSize()));
+ PatternClipboard::SetClipboardSize(conf.Read<int32>("Pattern Editor", "NumClipboards", mpt::saturate_cast<int32>(PatternClipboard::GetClipboardSize())));
// Update
{
@@ -845,7 +845,7 @@
CMainFrame::GetMainFrame()->GetWindowPlacement(&wpl);
conf.Write<WINDOWPLACEMENT>("Display", "WindowPlacement", wpl);
- conf.Write<uint32>("Pattern Editor", "NumClipboards", PatternClipboard::GetClipboardSize());
+ conf.Write<int32>("Pattern Editor", "NumClipboards", mpt::saturate_cast<int32>(PatternClipboard::GetClipboardSize()));
// Internet Update
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2015-03-05 00:08:33
|
Revision: 4829
http://sourceforge.net/p/modplug/code/4829
Author: saga-games
Date: 2015-03-05 00:08:20 +0000 (Thu, 05 Mar 2015)
Log Message:
-----------
[Imp] Instrument tab: Drag&Drop now also works with envelope files.
[Fix] Pattern tab: When only enabling Amiga limits for MOD but not PT1/2 mode, invalid notes were not coloured as such.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Draw_pat.cpp
trunk/OpenMPT/mptrack/View_ins.cpp
trunk/OpenMPT/mptrack/mptrack.rc
Modified: trunk/OpenMPT/mptrack/Draw_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Draw_pat.cpp 2015-03-04 18:04:26 UTC (rev 4828)
+++ trunk/OpenMPT/mptrack/Draw_pat.cpp 2015-03-05 00:08:20 UTC (rev 4829)
@@ -884,17 +884,19 @@
{
tx_col = MODCOLOR_NOTE;
- if(sndFile.m_SongFlags[SONG_PT1XMODE] && (m->note < NOTE_MIDDLEC - 12 || m->note >= NOTE_MIDDLEC + 2 * 12))
+ if(sndFile.m_SongFlags[SONG_AMIGALIMITS | SONG_PT1XMODE])
{
- // MOD "ProTracker 1.x" flag: Highlight notes that are not supported by Amiga trackers.
- tx_col = MODCOLOR_DODGY_COMMANDS;
- } else if(sndFile.m_SongFlags[SONG_AMIGALIMITS] && m->instr != 0 && m->instr <= sndFile.GetNumSamples())
- {
- // S3M "Force Amiga Limits": Highlight notes that exceed the Amiga's frequency range.
- UINT period = sndFile.GetPeriodFromNote(m->note, 0, sndFile.GetSample(m->instr).nC5Speed);
- if(period < 113 * 4 || period > 856 * 4)
+ // Highlight notes that exceed the Amiga's frequency range.
+ if(sndFile.GetType() == MOD_TYPE_MOD && (m->note < NOTE_MIDDLEC - 12 || m->note >= NOTE_MIDDLEC + 2 * 12))
{
tx_col = MODCOLOR_DODGY_COMMANDS;
+ } else if(sndFile.GetType() == MOD_TYPE_S3M && m->instr != 0 && m->instr <= sndFile.GetNumSamples())
+ {
+ uint32 period = sndFile.GetPeriodFromNote(m->note, 0, sndFile.GetSample(m->instr).nC5Speed);
+ if(period < 113 * 4 || period > 856 * 4)
+ {
+ tx_col = MODCOLOR_DODGY_COMMANDS;
+ }
}
}
}
Modified: trunk/OpenMPT/mptrack/View_ins.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_ins.cpp 2015-03-04 18:04:26 UTC (rev 4828)
+++ trunk/OpenMPT/mptrack/View_ins.cpp 2015-03-05 00:08:20 UTC (rev 4829)
@@ -2026,8 +2026,11 @@
if(::DragQueryFileW(hDropInfo, f, fileName, CountOf(fileName)))
{
const mpt::PathString file = mpt::PathString::FromNative(fileName);
- if(SendCtrlMessage(CTRLMSG_INS_OPENFILE, (LPARAM)&file) && f < nFiles - 1)
+ if(GetDocument()->LoadEnvelope(m_nInstrument, m_nEnv, file))
{
+ SetModified(InstrumentHint(m_nInstrument).Envelope(), true);
+ } else if(SendCtrlMessage(CTRLMSG_INS_OPENFILE, (LPARAM)&file) && f < nFiles - 1)
+ {
// Insert more instrument slots
SendCtrlMessage(IDC_INSTRUMENT_NEW);
}
Modified: trunk/OpenMPT/mptrack/mptrack.rc
===================================================================
--- trunk/OpenMPT/mptrack/mptrack.rc 2015-03-04 18:04:26 UTC (rev 4828)
+++ trunk/OpenMPT/mptrack/mptrack.rc 2015-03-05 00:08:20 UTC (rev 4829)
@@ -2547,10 +2547,14 @@
STRINGTABLE
BEGIN
+ ID_ENVELOPE_ZOOM_IN "Zoom In"
+ ID_ENVELOPE_ZOOM_OUT "Zoom Out"
ID_PANIC "Kill all VSTi and sample voices\nStop all hanging VSTi and sample voices"
ID_VIEW_EDITHISTORY "View the edit history of this module"
ID_SAMPLE_GRID "Configure Sample Grid"
ID_FILE_SAVEASTEMPLATE "Save the active document as template module\nSave as Template"
+ ID_ENVELOPE_LOAD "Load instrument envelope from file"
+ ID_ENVELOPE_SAVE "Save instrument envelope to file"
END
STRINGTABLE
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2015-03-08 15:32:31
|
Revision: 4839
http://sourceforge.net/p/modplug/code/4839
Author: saga-games
Date: 2015-03-08 15:32:18 +0000 (Sun, 08 Mar 2015)
Log Message:
-----------
[New] VST: Experimental feature: VST editors now have minimize / maximize buttons, which can be used to shrink a plugin window to only display the title and menu bar.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/AbstractVstEditor.cpp
trunk/OpenMPT/mptrack/AbstractVstEditor.h
trunk/OpenMPT/mptrack/mptrack.rc
Modified: trunk/OpenMPT/mptrack/AbstractVstEditor.cpp
===================================================================
--- trunk/OpenMPT/mptrack/AbstractVstEditor.cpp 2015-03-08 12:40:08 UTC (rev 4838)
+++ trunk/OpenMPT/mptrack/AbstractVstEditor.cpp 2015-03-08 15:32:18 UTC (rev 4839)
@@ -43,6 +43,7 @@
ON_WM_ACTIVATE()
ON_WM_DROPFILES()
ON_WM_MOVE()
+ ON_WM_SYSCOMMAND()
ON_COMMAND(ID_EDIT_COPY, OnCopyParameters)
ON_COMMAND(ID_EDIT_PASTE, OnPasteParameters)
ON_COMMAND(ID_PRESET_LOAD, OnLoadPreset)
@@ -102,6 +103,43 @@
}
+void CAbstractVstEditor::OnSysCommand(UINT nID, LPARAM lParam)
+//------------------------------------------------------------
+{
+ const UINT nID_ = nID & 0xFFF0;
+ if(nID_ == SC_MINIMIZE || nID_ == SC_MAXIMIZE)
+ {
+ // Override minimize and maximize buttons to reduce plugin windows to their non-client area
+ LONG style = GetWindowLong(m_hWnd, GWL_STYLE);
+ CRect rcWnd, rcClient;
+ GetWindowRect(&rcWnd);
+ if(nID_ == SC_MINIMIZE)
+ {
+ // When minimizing, remove the client area
+ GetClientRect(&rcClient);
+ clientHeight = rcClient.Height();
+
+ style &= ~WS_MINIMIZEBOX;
+ style |= WS_MAXIMIZEBOX;
+ } else
+ {
+ style |= WS_MINIMIZEBOX;
+ style &= ~WS_MAXIMIZEBOX;
+ }
+ clientHeight = -clientHeight;
+ int rcHeight = rcWnd.Height() + clientHeight;
+
+ SetWindowLong(m_hWnd, GWL_STYLE, style);
+ SetWindowPos(NULL, 0, 0,
+ rcWnd.Width(), rcHeight,
+ SWP_NOZORDER | SWP_NOMOVE);
+ } else
+ {
+ CDialog::OnSysCommand(nID, lParam);
+ }
+}
+
+
void CAbstractVstEditor::OnActivate(UINT nState, CWnd *pWndOther, BOOL bMinimized)
//--------------------------------------------------------------------------------
{
Modified: trunk/OpenMPT/mptrack/AbstractVstEditor.h
===================================================================
--- trunk/OpenMPT/mptrack/AbstractVstEditor.h 2015-03-08 12:40:08 UTC (rev 4838)
+++ trunk/OpenMPT/mptrack/AbstractVstEditor.h 2015-03-08 15:32:18 UTC (rev 4839)
@@ -31,7 +31,8 @@
CMenu m_OptionsMenu;
static UINT clipboardFormat;
int32 currentPresetMenu;
- bool updateDisplay;
+ int32 clientHeight;
+ bool updateDisplay : 1;
public:
CVstPlugin &m_VstPlugin;
@@ -48,6 +49,7 @@
void UpdatePresetField();
bool CreateInstrument();
+ afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnLoadPreset();
afx_msg void OnSavePreset();
afx_msg void OnCopyParameters();
Modified: trunk/OpenMPT/mptrack/mptrack.rc
===================================================================
--- trunk/OpenMPT/mptrack/mptrack.rc 2015-03-08 12:40:08 UTC (rev 4838)
+++ trunk/OpenMPT/mptrack/mptrack.rc 2015-03-08 15:32:18 UTC (rev 4839)
@@ -1572,8 +1572,8 @@
END
IDD_PLUGINEDITOR DIALOGEX 0, 0, 485, 153
-STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
-EXSTYLE WS_EX_TOOLWINDOW | WS_EX_CLIENTEDGE
+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
+EXSTYLE WS_EX_CLIENTEDGE
CAPTION "Editor"
MENU IDR_VSTMENU
FONT 8, "MS Shell Dlg", 0, 0, 0x1
@@ -2159,8 +2159,8 @@
MENUITEM "&OpenMPT Website", ID_NETLINK_MODPLUG
MENUITEM "&Web Resources", ID_NETLINK_TOP_PICKS
MENUITEM SEPARATOR
- MENUITEM "Check for &Updates...", ID_INTERNETUPDATE
- MENUITEM "&About OpenMPT...", ID_APP_ABOUT
+ MENUITEM "Check for &Updates", ID_INTERNETUPDATE
+ MENUITEM "&About OpenMPT", ID_APP_ABOUT
END
END
@@ -2702,8 +2702,7 @@
END
IDD_DEFAULTPLUGINEDITOR DIALOGEX 0, 0, 336, 247
-STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
-EXSTYLE WS_EX_TOOLWINDOW
+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Editor"
FONT 8, "MS Shell Dlg", 400, 0, 0x0
BEGIN
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2015-03-10 15:20:27
|
Revision: 4849
http://sourceforge.net/p/modplug/code/4849
Author: saga-games
Date: 2015-03-10 15:20:21 +0000 (Tue, 10 Mar 2015)
Log Message:
-----------
[Imp] Instrument tab: Entering a negative scaling factor also gives sensible results for the volume and filter envelope now.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/ScaleEnvPointsDlg.cpp
trunk/OpenMPT/mptrack/mptrack.rc
Modified: trunk/OpenMPT/mptrack/ScaleEnvPointsDlg.cpp
===================================================================
--- trunk/OpenMPT/mptrack/ScaleEnvPointsDlg.cpp 2015-03-10 15:11:35 UTC (rev 4848)
+++ trunk/OpenMPT/mptrack/ScaleEnvPointsDlg.cpp 2015-03-10 15:20:21 UTC (rev 4849)
@@ -61,9 +61,17 @@
if(m_fFactorY != 1)
{
+ float factor = m_fFactorY;
+ bool invert = false;
+ if(m_fFactorY < 0)
+ {
+ invert = true;
+ factor = -factor;
+ }
for(uint32 i = 0; i < m_Env.nNodes; i++)
{
- m_Env.Values[i] = Clamp(static_cast<uint8>((m_fFactorY * ((int)m_Env.Values[i] - m_nCenter)) + m_nCenter), uint8(ENVELOPE_MIN), uint8(ENVELOPE_MAX));
+ if(invert) m_Env.Values[i] = ENVELOPE_MAX - m_Env.Values[i];
+ m_Env.Values[i] = Clamp(static_cast<uint8>((factor * ((int)m_Env.Values[i] - m_nCenter)) + m_nCenter), uint8(ENVELOPE_MIN), uint8(ENVELOPE_MAX));
}
}
Modified: trunk/OpenMPT/mptrack/mptrack.rc
===================================================================
--- trunk/OpenMPT/mptrack/mptrack.rc 2015-03-10 15:11:35 UTC (rev 4848)
+++ trunk/OpenMPT/mptrack/mptrack.rc 2015-03-10 15:20:21 UTC (rev 4849)
@@ -2187,7 +2187,7 @@
MENUITEM "&Copy envelope", ID_EDIT_COPY
MENUITEM "&Paste envelope", ID_EDIT_PASTE
MENUITEM SEPARATOR
- MENUITEM "Scale Envelope Points...", ID_ENVELOPE_SCALEPOINTS
+ MENUITEM "Scale &Envelope Points...", ID_ENVELOPE_SCALEPOINTS
END
END
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2015-03-10 15:49:53
|
Revision: 4850
http://sourceforge.net/p/modplug/code/4850
Author: saga-games
Date: 2015-03-10 15:49:47 +0000 (Tue, 10 Mar 2015)
Log Message:
-----------
[New] Pattern tab: Added option to transpose a whole channel.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/View_pat.cpp
trunk/OpenMPT/mptrack/View_pat.h
trunk/OpenMPT/mptrack/resource.h
Modified: trunk/OpenMPT/mptrack/View_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_pat.cpp 2015-03-10 15:20:21 UTC (rev 4849)
+++ trunk/OpenMPT/mptrack/View_pat.cpp 2015-03-10 15:49:47 UTC (rev 4850)
@@ -122,6 +122,7 @@
ON_COMMAND(ID_PATTERN_SETINSTRUMENT, OnSetSelInstrument)
ON_COMMAND(ID_PATTERN_ADDCHANNEL_FRONT, OnAddChannelFront)
ON_COMMAND(ID_PATTERN_ADDCHANNEL_AFTER, OnAddChannelAfter)
+ ON_COMMAND(ID_PATTERN_TRANSPOSECHANNEL, OnTransposeChannel)
ON_COMMAND(ID_PATTERN_DUPLICATECHANNEL, OnDuplicateChannel)
ON_COMMAND(ID_PATTERN_REMOVECHANNEL, OnRemoveChannel)
ON_COMMAND(ID_PATTERN_REMOVECHANNELDIALOG, OnRemoveChannelDialog)
@@ -153,6 +154,7 @@
m_pEffectVis = nullptr; //rewbs.fxvis
m_bLastNoteEntryBlocked = false;
+ m_nTransposeAmount = 1;
m_nPattern = 0;
m_nDetailLevel = PatternCursor::lastColumn;
m_pEditWnd = NULL;
@@ -2888,14 +2890,60 @@
}
+void CViewPattern::OnTransposeChannel()
+//-------------------------------------
+{
+ CInputDlg dlg(this, "Enter transpose amount:", -(NOTE_MAX - NOTE_MIN), (NOTE_MAX - NOTE_MIN), m_nTransposeAmount);
+ if(dlg.DoModal() == IDOK)
+ {
+ m_nTransposeAmount = dlg.resultNumber;
+
+ CSoundFile &sndFile = *GetSoundFile();
+ bool changed = false;
+ // Don't allow notes outside our supported note range.
+ const ModCommand::NOTE noteMin = sndFile.GetModSpecifications().noteMin;
+ const ModCommand::NOTE noteMax = sndFile.GetModSpecifications().noteMax;
+
+ for(PATTERNINDEX pat = 0; pat < sndFile.Patterns.Size(); pat++)
+ {
+ bool changedThisPat = false;
+ if(sndFile.Patterns.IsValidPat(pat))
+ {
+ ModCommand *m = sndFile.Patterns[pat].GetpModCommand(0, m_MenuCursor.GetChannel());
+ const ROWINDEX numRows = sndFile.Patterns[pat].GetNumRows();
+ for(ROWINDEX row = 0; row < numRows; row++)
+ {
+ if(m->IsNote())
+ {
+ if(!changedThisPat)
+ {
+ GetDocument()->GetPatternUndo().PrepareUndo(pat, m_MenuCursor.GetChannel(), 0, 1, numRows, "Transpose Channel", changed);
+ changed = changedThisPat = true;
+ }
+ int note = m->note + m_nTransposeAmount;
+ Limit(note, noteMin, noteMax);
+ m->note = static_cast<ModCommand::NOTE>(note);
+ }
+ m += sndFile.Patterns[pat].GetNumChannels();
+ }
+ }
+ }
+ if(changed)
+ {
+ SetModified(true);
+ InvalidatePattern(false);
+ }
+ }
+}
+
+
void CViewPattern::OnTransposeCustom()
//------------------------------------
{
- static int32 tranpose = 1;
- CInputDlg dlg(this, "Enter transpose amount:", -(NOTE_MAX - NOTE_MIN), (NOTE_MAX - NOTE_MIN), tranpose);
+ CInputDlg dlg(this, "Enter transpose amount:", -(NOTE_MAX - NOTE_MIN), (NOTE_MAX - NOTE_MIN), m_nTransposeAmount);
if(dlg.DoModal() == IDOK)
{
- tranpose = dlg.resultNumber;
+ m_nTransposeAmount = dlg.resultNumber;
TransposeSelection(dlg.resultNumber);
}
}
@@ -2930,7 +2978,7 @@
{
int note = m[chn].note + transp;
Limit(note, noteMin, noteMax);
- m[chn].note = (ModCommand::NOTE)note;
+ m[chn].note = static_cast<ModCommand::NOTE>(note);
}
}
}
@@ -3310,6 +3358,7 @@
EndWaitCursor();
}
+
void CViewPattern::OnRunScript()
//------------------------------
{
@@ -6306,7 +6355,8 @@
{
AppendMenu(hMenu, MF_SEPARATOR, 0, "");
- AppendMenu(hMenu, MF_STRING, ID_PATTERN_DUPLICATECHANNEL, "&Duplicate this channel");
+ AppendMenu(hMenu, MF_STRING, ID_PATTERN_TRANSPOSECHANNEL, "&Transpose channel");
+ AppendMenu(hMenu, MF_STRING, ID_PATTERN_DUPLICATECHANNEL, "&Duplicate channel");
HMENU addChannelMenu = ::CreatePopupMenu();
AppendMenu(hMenu, MF_POPUP, reinterpret_cast<UINT_PTR>(addChannelMenu), "&Add channel\t");
Modified: trunk/OpenMPT/mptrack/View_pat.h
===================================================================
--- trunk/OpenMPT/mptrack/View_pat.h 2015-03-10 15:20:21 UTC (rev 4849)
+++ trunk/OpenMPT/mptrack/View_pat.h 2015-03-10 15:49:47 UTC (rev 4850)
@@ -165,6 +165,7 @@
ROWINDEX m_nPlayRow;
UINT m_nPlayTick;
PATTERNINDEX m_nPattern, m_nPlayPat;
+ int32 m_nTransposeAmount;
int m_nXScroll, m_nYScroll;
PatternCursor::Columns m_nDetailLevel; // Visible Columns
@@ -183,8 +184,8 @@
UINT m_nFoundInstrument;
DWORD m_dwLastNoteEntryTime; //rewbs.customkeys
- bool m_bLastNoteEntryBlocked;
- bool m_bContinueSearch, m_bWholePatternFitsOnScreen;
+ bool m_bLastNoteEntryBlocked : 1;
+ bool m_bContinueSearch : 1, m_bWholePatternFitsOnScreen : 1;
ModCommand m_PCNoteEditMemory; // PC Note edit memory
static ModCommand m_cmdOld; // Quick cursor copy/paste data
@@ -419,6 +420,7 @@
afx_msg void OnAddChannelFront() { AddChannelBefore(m_MenuCursor.GetChannel()); }
afx_msg void OnAddChannelAfter() { AddChannelBefore(m_MenuCursor.GetChannel() + 1); };
afx_msg void OnDuplicateChannel();
+ afx_msg void OnTransposeChannel();
afx_msg void OnRemoveChannel();
afx_msg void OnRemoveChannelDialog();
afx_msg void OnPatternProperties();
Modified: trunk/OpenMPT/mptrack/resource.h
===================================================================
--- trunk/OpenMPT/mptrack/resource.h 2015-03-10 15:20:21 UTC (rev 4849)
+++ trunk/OpenMPT/mptrack/resource.h 2015-03-10 15:49:47 UTC (rev 4850)
@@ -1166,8 +1166,10 @@
#define ID_SHRINK_SELECTION 43002
#define ID_RUN_SCRIPT 43003
#define ID_EXAMPLE_MODULES 43004
+// From here: Command range [ID_EXAMPLE_MODULES, ID_EXAMPLE_MODULES_LASTINRANGE]
#define ID_EXAMPLE_MODULES_LASTINRANGE 43053
#define ID_FILE_OPENTEMPLATE 43054
+// From here: Command range [ID_FILE_OPENTEMPLATE, ID_FILE_OPENTEMPLATE_LASTINRANGE]
#define ID_FILE_OPENTEMPLATE_LASTINRANGE 43103
#define ID_INDICATOR_TIME 43143
#define ID_INDICATOR_USER 43144
@@ -1183,6 +1185,7 @@
#define ID_ENVELOPE_TOGGLERELEASENODE 43154
#define ID_ENVELOPE_SCALEPOINTS 43155
#define ID_VIEW_MIDIMAPPING 43156
+#define ID_PATTERN_TRANSPOSECHANNEL 43215
#define ID_PATTERN_DUPLICATECHANNEL 43216
#define ID_EDIT_GOTO_MENU 43217
#define ID_CLEANUP_COMPO 43218
@@ -1245,6 +1248,7 @@
#define ID_SETQUANTIZE 44609
#define ID_PLUG_RECORD_MIDIOUT 44610
#define ID_MRU_LIST_FIRST 44611
+// From here: Command range [ID_MRU_LIST_FIRST, ID_MRU_LIST_LAST]
#define ID_MRU_LIST_LAST 44642
#define ID_FILE_APPENDMODULE 44643
#define ID_SAMPLE_16BITCONVERT 44644
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2015-03-10 18:24:20
|
Revision: 4854
http://sourceforge.net/p/modplug/code/4854
Author: saga-games
Date: 2015-03-10 18:24:07 +0000 (Tue, 10 Mar 2015)
Log Message:
-----------
[Mod] actually show new shortcuts in the context menu.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/View_pat.cpp
trunk/OpenMPT/mptrack/View_pat.h
Modified: trunk/OpenMPT/mptrack/View_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_pat.cpp 2015-03-10 18:20:29 UTC (rev 4853)
+++ trunk/OpenMPT/mptrack/View_pat.cpp 2015-03-10 18:24:07 UTC (rev 4854)
@@ -1451,7 +1451,7 @@
if (BuildSoloMuteCtxMenu(hMenu, ih, nChn, pSndFile))
AppendMenu(hMenu, MF_SEPARATOR, 0, "");
BuildRecordCtxMenu(hMenu, ih, nChn, pModDoc);
- BuildChannelControlCtxMenu(hMenu);
+ BuildChannelControlCtxMenu(hMenu, ih);
}
}
@@ -6356,13 +6356,13 @@
}
-bool CViewPattern::BuildChannelControlCtxMenu(HMENU hMenu) const
-//--------------------------------------------------------------
+bool CViewPattern::BuildChannelControlCtxMenu(HMENU hMenu, CInputHandler *ih) const
+//---------------------------------------------------------------------------------
{
AppendMenu(hMenu, MF_SEPARATOR, 0, "");
- AppendMenu(hMenu, MF_STRING, ID_PATTERN_TRANSPOSECHANNEL, "&Transpose Channel");
- AppendMenu(hMenu, MF_STRING, ID_PATTERN_DUPLICATECHANNEL, "&Duplicate Channel");
+ AppendMenu(hMenu, MF_STRING, ID_PATTERN_TRANSPOSECHANNEL, "&Transpose Channel\t" + ih->GetKeyTextFromCommand(kcChannelTranspose));
+ AppendMenu(hMenu, MF_STRING, ID_PATTERN_DUPLICATECHANNEL, "&Duplicate Channel\t" + ih->GetKeyTextFromCommand(kcChannelDuplicate));
HMENU addChannelMenu = ::CreatePopupMenu();
AppendMenu(hMenu, MF_POPUP, reinterpret_cast<UINT_PTR>(addChannelMenu), "&Add Channel\t");
Modified: trunk/OpenMPT/mptrack/View_pat.h
===================================================================
--- trunk/OpenMPT/mptrack/View_pat.h 2015-03-10 18:20:29 UTC (rev 4853)
+++ trunk/OpenMPT/mptrack/View_pat.h 2015-03-10 18:24:07 UTC (rev 4854)
@@ -460,7 +460,7 @@
CHANNELINDEX FindGroupRecordChannel(BYTE recordGroup, bool forceFreeChannel, CHANNELINDEX startChannel = 0) const;
- bool BuildChannelControlCtxMenu(HMENU hMenu) const;
+ bool BuildChannelControlCtxMenu(HMENU hMenu, CInputHandler *ih) const;
bool BuildPluginCtxMenu(HMENU hMenu, UINT nChn, CSoundFile *pSndFile) const;
bool BuildRecordCtxMenu(HMENU hMenu, CInputHandler *ih, CHANNELINDEX nChn, CModDoc *pModDoc) const;
bool BuildSoloMuteCtxMenu(HMENU hMenu, CInputHandler *ih, UINT nChn, CSoundFile *pSndFile) const;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <man...@us...> - 2015-03-10 22:31:41
|
Revision: 4857
http://sourceforge.net/p/modplug/code/4857
Author: manxorist
Date: 2015-03-10 22:31:34 +0000 (Tue, 10 Mar 2015)
Log Message:
-----------
[Ref] Stream Export: mpt::ustring conversion.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Mod2wave.cpp
trunk/OpenMPT/mptrack/StreamEncoder.cpp
trunk/OpenMPT/mptrack/StreamEncoder.h
trunk/OpenMPT/mptrack/StreamEncoderMP3.cpp
trunk/OpenMPT/mptrack/StreamEncoderMP3.h
trunk/OpenMPT/mptrack/StreamEncoderVorbis.cpp
trunk/OpenMPT/mptrack/StreamEncoderVorbis.h
Modified: trunk/OpenMPT/mptrack/Mod2wave.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Mod2wave.cpp 2015-03-10 21:33:04 UTC (rev 4856)
+++ trunk/OpenMPT/mptrack/Mod2wave.cpp 2015-03-10 22:31:34 UTC (rev 4857)
@@ -373,7 +373,7 @@
{
for(int quality = 100; quality >= 0; quality -= 10)
{
- int ndx = m_CbnSampleFormat.AddString(m_Settings.GetEncoderFactory()->DescribeQuality(quality * 0.01f).c_str());
+ int ndx = m_CbnSampleFormat.AddString(mpt::ToCString(m_Settings.GetEncoderFactory()->DescribeQuality(quality * 0.01f)));
m_CbnSampleFormat.SetItemData(ndx, (Encoder::ModeQuality<<24) | (quality<<0));
if(encSettings.Mode == Encoder::ModeQuality && Util::Round<int>(encSettings.Quality*100.0f) == quality)
{
@@ -385,7 +385,7 @@
{
for(std::size_t bitrate = encTraits->bitrates.size()-1; bitrate >= 0; --bitrate)
{
- int ndx = m_CbnSampleFormat.AddString(m_Settings.GetEncoderFactory()->DescribeBitrateVBR(encTraits->bitrates[bitrate]).c_str());
+ int ndx = m_CbnSampleFormat.AddString(mpt::ToCString(m_Settings.GetEncoderFactory()->DescribeBitrateVBR(encTraits->bitrates[bitrate])));
m_CbnSampleFormat.SetItemData(ndx, (Encoder::ModeVBR<<24) | (encTraits->bitrates[bitrate]<<0));
if(encSettings.Mode == Encoder::ModeVBR && static_cast<int>(encSettings.Bitrate) == encTraits->bitrates[bitrate])
{
@@ -397,7 +397,7 @@
{
for(std::size_t bitrate = encTraits->bitrates.size()-1; bitrate >= 0; --bitrate)
{
- int ndx = m_CbnSampleFormat.AddString(m_Settings.GetEncoderFactory()->DescribeBitrateABR(encTraits->bitrates[bitrate]).c_str());
+ int ndx = m_CbnSampleFormat.AddString(mpt::ToCString(m_Settings.GetEncoderFactory()->DescribeBitrateABR(encTraits->bitrates[bitrate])));
m_CbnSampleFormat.SetItemData(ndx, (Encoder::ModeABR<<24) | (encTraits->bitrates[bitrate]<<0));
if(encSettings.Mode == Encoder::ModeABR && static_cast<int>(encSettings.Bitrate) == encTraits->bitrates[bitrate])
{
@@ -409,7 +409,7 @@
{
for(std::size_t bitrate = encTraits->bitrates.size()-1; bitrate >= 0; --bitrate)
{
- int ndx = m_CbnSampleFormat.AddString(m_Settings.GetEncoderFactory()->DescribeBitrateCBR(encTraits->bitrates[bitrate]).c_str());
+ int ndx = m_CbnSampleFormat.AddString(mpt::ToCString(m_Settings.GetEncoderFactory()->DescribeBitrateCBR(encTraits->bitrates[bitrate])));
m_CbnSampleFormat.SetItemData(ndx, (Encoder::ModeCBR<<24) | (encTraits->bitrates[bitrate]<<0));
if(encSettings.Mode == Encoder::ModeCBR && static_cast<int>(encSettings.Bitrate) == encTraits->bitrates[bitrate])
{
Modified: trunk/OpenMPT/mptrack/StreamEncoder.cpp
===================================================================
--- trunk/OpenMPT/mptrack/StreamEncoder.cpp 2015-03-10 21:33:04 UTC (rev 4856)
+++ trunk/OpenMPT/mptrack/StreamEncoder.cpp 2015-03-10 22:31:34 UTC (rev 4857)
@@ -99,28 +99,28 @@
}
-std::string EncoderFactoryBase::DescribeQuality(float quality) const
-//------------------------------------------------------------------
+mpt::ustring EncoderFactoryBase::DescribeQuality(float quality) const
+//-------------------------------------------------------------------
{
- return mpt::String::Print("VBR %1%%", static_cast<int>(quality * 100.0f));
+ return mpt::String::Print(MPT_USTRING("VBR %1%%"), static_cast<int>(quality * 100.0f));
}
-std::string EncoderFactoryBase::DescribeBitrateVBR(int bitrate) const
-//-------------------------------------------------------------------
+mpt::ustring EncoderFactoryBase::DescribeBitrateVBR(int bitrate) const
+//--------------------------------------------------------------------
{
- return mpt::String::Print("VBR %1 kbit", bitrate);
+ return mpt::String::Print(MPT_USTRING("VBR %1 kbit"), bitrate);
}
-std::string EncoderFactoryBase::DescribeBitrateABR(int bitrate) const
-//-------------------------------------------------------------------
+mpt::ustring EncoderFactoryBase::DescribeBitrateABR(int bitrate) const
+//--------------------------------------------------------------------
{
- return mpt::String::Print("ABR %1 kbit", bitrate);
+ return mpt::String::Print(MPT_USTRING("ABR %1 kbit"), bitrate);
}
-std::string EncoderFactoryBase::DescribeBitrateCBR(int bitrate) const
-//-------------------------------------------------------------------
+mpt::ustring EncoderFactoryBase::DescribeBitrateCBR(int bitrate) const
+//--------------------------------------------------------------------
{
- return mpt::String::Print("CBR %1 kbit", bitrate);
+ return mpt::String::Print(MPT_USTRING("CBR %1 kbit"), bitrate);
}
Modified: trunk/OpenMPT/mptrack/StreamEncoder.h
===================================================================
--- trunk/OpenMPT/mptrack/StreamEncoder.h 2015-03-10 21:33:04 UTC (rev 4856)
+++ trunk/OpenMPT/mptrack/StreamEncoder.h 2015-03-10 22:31:34 UTC (rev 4857)
@@ -263,10 +263,10 @@
{
return traits;
}
- virtual std::string DescribeQuality(float quality) const;
- virtual std::string DescribeBitrateVBR(int bitrate) const;
- virtual std::string DescribeBitrateABR(int bitrate) const;
- virtual std::string DescribeBitrateCBR(int bitrate) const;
+ virtual mpt::ustring DescribeQuality(float quality) const;
+ virtual mpt::ustring DescribeBitrateVBR(int bitrate) const;
+ virtual mpt::ustring DescribeBitrateABR(int bitrate) const;
+ virtual mpt::ustring DescribeBitrateCBR(int bitrate) const;
virtual bool IsAvailable() const = 0;
};
Modified: trunk/OpenMPT/mptrack/StreamEncoderMP3.cpp
===================================================================
--- trunk/OpenMPT/mptrack/StreamEncoderMP3.cpp 2015-03-10 21:33:04 UTC (rev 4856)
+++ trunk/OpenMPT/mptrack/StreamEncoderMP3.cpp 2015-03-10 22:31:34 UTC (rev 4857)
@@ -1520,8 +1520,8 @@
}
-std::string MP3Encoder::DescribeQuality(float quality) const
-//----------------------------------------------------------
+mpt::ustring MP3Encoder::DescribeQuality(float quality) const
+//-----------------------------------------------------------
{
#ifdef MPT_MP3ENCODER_LAME
if(m_Type == MP3EncoderLame)
@@ -1531,23 +1531,23 @@
if(q < 0) q = 0;
if(q >= 10)
{
- return mpt::String::Print("VBR -V%1 (~%2 kbit)", "9.999", q_table[q]);
+ return mpt::String::Print(MPT_USTRING("VBR -V%1 (~%2 kbit)"), MPT_USTRING("9.999"), q_table[q]);
} else
{
- return mpt::String::Print("VBR -V%1 (~%2 kbit)", Util::Round<int>((1.0f - quality) * 10.0f), q_table[q]);
+ return mpt::String::Print(MPT_USTRING("VBR -V%1 (~%2 kbit)"), Util::Round<int>((1.0f - quality) * 10.0f), q_table[q]);
}
}
#endif // MPT_MP3ENCODER_LAME
return EncoderFactoryBase::DescribeQuality(quality);
}
-std::string MP3Encoder::DescribeBitrateABR(int bitrate) const
-//-----------------------------------------------------------
+mpt::ustring MP3Encoder::DescribeBitrateABR(int bitrate) const
+//------------------------------------------------------------
{
#ifdef MPT_MP3ENCODER_BLADE
if(m_Type == MP3EncoderBlade)
{
- return mpt::String::Print("%1 kbit", bitrate);
+ return mpt::String::Print(MPT_USTRING("%1 kbit"), bitrate);
}
#endif // MPT_MP3ENCODER_BLADE
return EncoderFactoryBase::DescribeBitrateABR(bitrate);
Modified: trunk/OpenMPT/mptrack/StreamEncoderMP3.h
===================================================================
--- trunk/OpenMPT/mptrack/StreamEncoderMP3.h 2015-03-10 21:33:04 UTC (rev 4856)
+++ trunk/OpenMPT/mptrack/StreamEncoderMP3.h 2015-03-10 22:31:34 UTC (rev 4857)
@@ -61,8 +61,8 @@
public:
IAudioStreamEncoder *ConstructStreamEncoder(std::ostream &file) const;
- std::string DescribeQuality(float quality) const;
- std::string DescribeBitrateABR(int bitrate) const;
+ mpt::ustring DescribeQuality(float quality) const;
+ mpt::ustring DescribeBitrateABR(int bitrate) const;
bool IsAvailable() const;
public:
Modified: trunk/OpenMPT/mptrack/StreamEncoderVorbis.cpp
===================================================================
--- trunk/OpenMPT/mptrack/StreamEncoderVorbis.cpp 2015-03-10 21:33:04 UTC (rev 4856)
+++ trunk/OpenMPT/mptrack/StreamEncoderVorbis.cpp 2015-03-10 22:31:34 UTC (rev 4857)
@@ -437,12 +437,12 @@
}
-std::string VorbisEncoder::DescribeQuality(float quality) const
-//-------------------------------------------------------------
+mpt::ustring VorbisEncoder::DescribeQuality(float quality) const
+//--------------------------------------------------------------
{
static const int q_table[11] = { 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 500 }; // http://wiki.hydrogenaud.io/index.php?title=Recommended_Ogg_Vorbis
int q = Clamp(Util::Round<int>(quality * 10.0f), 0, 10);
- return mpt::String::Print("Q%1 (~%2 kbit)", mpt::fmt::f("%3.1f", quality * 10.0f), q_table[q]);
+ return mpt::String::Print(MPT_USTRING("Q%1 (~%2 kbit)"), mpt::ufmt::f("%3.1f", quality * 10.0f), q_table[q]);
}
Modified: trunk/OpenMPT/mptrack/StreamEncoderVorbis.h
===================================================================
--- trunk/OpenMPT/mptrack/StreamEncoderVorbis.h 2015-03-10 21:33:04 UTC (rev 4856)
+++ trunk/OpenMPT/mptrack/StreamEncoderVorbis.h 2015-03-10 22:31:34 UTC (rev 4857)
@@ -30,7 +30,7 @@
public:
IAudioStreamEncoder *ConstructStreamEncoder(std::ostream &file) const;
- std::string DescribeQuality(float quality) const;
+ mpt::ustring DescribeQuality(float quality) const;
bool IsAvailable() const;
public:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2015-03-14 15:23:12
|
Revision: 4885
http://sourceforge.net/p/modplug/code/4885
Author: saga-games
Date: 2015-03-14 15:23:06 +0000 (Sat, 14 Mar 2015)
Log Message:
-----------
[Fix] Sample tab: Pitch shift was broken for stereo samples.
[Fix] Sample tab: Preserve zoom when switching to another sample after using center around loop point functionality on an auto-zoomed sample.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Ctrl_smp.cpp
trunk/OpenMPT/mptrack/View_smp.cpp
Modified: trunk/OpenMPT/mptrack/Ctrl_smp.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2015-03-13 23:52:26 UTC (rev 4884)
+++ trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2015-03-14 15:23:06 UTC (rev 4885)
@@ -2182,10 +2182,10 @@
switch(smpsize)
{
case 1:
- CopySample<SC::ConversionChain<SC::Convert<float, int8>, SC::DecodeIdentity<int8> > >(buffer, len, 1, ptr, sizeof(int8) * len, nChn);
+ CopySample<SC::ConversionChain<SC::Convert<float, int8>, SC::DecodeIdentity<int8> > >(buffer, len, 1, ptr, sizeof(int8) * len * nChn, nChn);
break;
case 2:
- CopySample<SC::ConversionChain<SC::Convert<float, int16>, SC::DecodeIdentity<int16> > >(buffer, len, 1, (int16 *)ptr, sizeof(int16) * len, nChn);
+ CopySample<SC::ConversionChain<SC::Convert<float, int16>, SC::DecodeIdentity<int16> > >(buffer, len, 1, (int16 *)ptr, sizeof(int16) * len * nChn, nChn);
break;
}
@@ -3149,7 +3149,7 @@
// Crossfade loop to create smooth loop transitions
#define DEFAULT_XFADE_LENGTH 16384 //4096
-SmpLength LimitXFadeLength(SmpLength len, const ModSample &sample)
+static SmpLength LimitXFadeLength(SmpLength len, const ModSample &sample)
{
return Util::Min(len, sample.nLoopEnd - sample.nLoopStart, sample.nLoopEnd / 2);
}
Modified: trunk/OpenMPT/mptrack/View_smp.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_smp.cpp 2015-03-13 23:52:26 UTC (rev 4884)
+++ trunk/OpenMPT/mptrack/View_smp.cpp 2015-03-14 15:23:06 UTC (rev 4885)
@@ -2944,9 +2944,13 @@
case kcSampleCenterSustainEnd: point = sample.nSustainEnd; break;
}
if(!m_nZoom)
+ {
+ SendCtrlMessage(CTRLMSG_SMP_SETZOOM, 1);
SetZoom(1, point);
- else
+ } else
+ {
ScrollToSample(point);
+ }
}
return wParam;
case kcPrevInstrument: OnPrevInstrument(); return wParam;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2015-03-28 01:04:42
|
Revision: 4907
http://sourceforge.net/p/modplug/code/4907
Author: saga-games
Date: 2015-03-28 01:04:29 +0000 (Sat, 28 Mar 2015)
Log Message:
-----------
[Fix] Pattern tab: Can now also click on the first and last item of an order selection to remove the selection.
[Mod] Pattern tab: Remove arbitrary limiting of the scrollbar to the first --- item in MOD/XM
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Ctrl_pat.h
trunk/OpenMPT/mptrack/Ctrl_seq.cpp
Modified: trunk/OpenMPT/mptrack/Ctrl_pat.h
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_pat.h 2015-03-27 15:18:21 UTC (rev 4906)
+++ trunk/OpenMPT/mptrack/Ctrl_pat.h 2015-03-28 01:04:29 UTC (rev 4907)
@@ -39,7 +39,7 @@
//m_nScrollPos: The same as order
//m_nScrollPos2nd: 2nd selection point if multiple orders are selected
// (not neccessarily the higher order - GetCurSel() is taking care of that.)
- ORDERINDEX m_nXScroll, m_nScrollPos, m_nScrollPos2nd, m_nDropPos;
+ ORDERINDEX m_nXScroll, m_nScrollPos, m_nScrollPos2nd, m_nDropPos, m_nMouseDownPos;
ORDERINDEX m_nDragOrder;
//To tell how many orders('orderboxes') to show at least
//on both sides of current order(when updating orderslist position).
Modified: trunk/OpenMPT/mptrack/Ctrl_seq.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2015-03-27 15:18:21 UTC (rev 4906)
+++ trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2015-03-28 01:04:29 UTC (rev 4907)
@@ -173,16 +173,7 @@
SCROLLINFO info;
UINT nPage;
- int nMax = 0;
- if(!sndFile.GetModSpecifications().hasStopIndex)
- {
- // With MOD / XM, cut shown sequence to first '---' item...
- nMax = sndFile.Order.GetLengthFirstEmpty();
- } else
- {
- // ...for S3M/IT/MPT, show sequence until the last used item.
- nMax = sndFile.Order.GetLengthTailTrimmed();
- }
+ int nMax = sndFile.Order.GetLengthTailTrimmed();
GetScrollInfo(SB_HORZ, &info, SIF_PAGE|SIF_RANGE);
info.fMask = SIF_PAGE|SIF_RANGE;
@@ -377,7 +368,6 @@
BOOL COrderList::PreTranslateMessage(MSG *pMsg)
//---------------------------------------------
{
- //rewbs.customKeys:
//handle Patterns View context keys that we want to take effect in the orderlist.
if ((pMsg->message == WM_SYSKEYUP) || (pMsg->message == WM_KEYUP) ||
(pMsg->message == WM_SYSKEYDOWN) || (pMsg->message == WM_KEYDOWN))
@@ -390,19 +380,16 @@
UINT nFlags = HIWORD(pMsg->lParam);
KeyEventType kT = ih->GetKeyEventType(nFlags);
- InputTargetContext ctx = (InputTargetContext)(kCtxCtrlOrderlist);
- if (ih->KeyEvent(ctx, nChar, nRepCnt, nFlags, kT) != kcNull)
+ if (ih->KeyEvent(kCtxCtrlOrderlist, nChar, nRepCnt, nFlags, kT) != kcNull)
return true; // Mapped to a command, no need to pass message on.
//HACK: masquerade as kCtxViewPatternsNote context until we implement appropriate
// command propagation to kCtxCtrlOrderlist context.
- ctx = (InputTargetContext)(kCtxViewPatternsNote);
- if (ih->KeyEvent(ctx, nChar, nRepCnt, nFlags, kT) != kcNull)
+ if (ih->KeyEvent(kCtxViewPatternsNote, nChar, nRepCnt, nFlags, kT) != kcNull)
return true; // Mapped to a command, no need to pass message on.
}
- //end rewbs.customKeys
return CWnd::PreTranslateMessage(pMsg);
}
@@ -617,8 +604,7 @@
CHAR s[128];
strcpy(s, "");
- // MOD orderlist always ends after first empty pattern
- const ORDERINDEX nLength = (sndFile.GetType() & MOD_TYPE_MOD) ? sndFile.Order.GetLengthFirstEmpty() : sndFile.Order.GetLengthTailTrimmed();
+ const ORDERINDEX nLength = sndFile.Order.GetLengthTailTrimmed();
if(TrackerSettings::Instance().m_dwPatternSetup & PATTERN_HEXDISPLAY)
{
@@ -805,10 +791,10 @@
}
m_bDragging = !IsOrderInMargins(m_nScrollPos, oldXScroll) || !IsOrderInMargins(m_nScrollPos2nd, oldXScroll);
+ m_nMouseDownPos = nOrder;
if(m_bDragging)
{
- m_nDragOrder = GetCurSel(true).firstOrd;
- m_nDropPos = m_nDragOrder;
+ m_nDragOrder = m_nDropPos = GetCurSel(true).firstOrd;
SetCapture();
}
}
@@ -835,7 +821,7 @@
if (rect.PtInRect(pt))
{
ORDERINDEX n = GetOrderFromPoint(rect, pt);
- if ((n != ORDERINDEX_INVALID) && (n == m_nDropPos))
+ if (n != ORDERINDEX_INVALID && n == m_nDropPos && n != m_nMouseDownPos)
{
// drag multiple orders (not quite as easy...)
OrdSelection selection = GetCurSel(false);
@@ -880,16 +866,12 @@
}
} else
{
- ORDERINDEX nOrder = GetOrderFromPoint(rect, pt);
- OrdSelection selection = GetCurSel(false);
-
- // this should actually have equal signs but that breaks multiselect: nOrder >= selection.nOrdLo && nOrder <= section.nOrdHi
- if(pt.y < rect.bottom && m_nScrollPos2nd != ORDERINDEX_INVALID && nOrder > selection.firstOrd && nOrder < selection.lastOrd)
+ if(pt.y < rect.bottom && n == m_nMouseDownPos && !copyOrders)
{
// Remove selection if we didn't drag anything but multiselect was active
m_nScrollPos2nd = ORDERINDEX_INVALID;
SetFocus();
- SetCurSel(GetOrderFromPoint(rect, pt));
+ SetCurSel(n);
}
}
}
@@ -920,6 +902,7 @@
{
if (n != ORDERINDEX_INVALID)
{
+ m_nMouseDownPos = ORDERINDEX_INVALID;
m_nDropPos = n;
InvalidateRect(NULL, FALSE);
SetCursor(CMainFrame::curDragging);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2015-03-28 19:50:22
|
Revision: 4908
http://sourceforge.net/p/modplug/code/4908
Author: saga-games
Date: 2015-03-28 19:50:09 +0000 (Sat, 28 Mar 2015)
Log Message:
-----------
[Mod] Tree view: When confirming the deletion of an unused pattern, show this in the message and default to Yes.
[Fix] When loading a template, also reset the tracker ID string.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Mptrack.cpp
trunk/OpenMPT/mptrack/View_tre.cpp
Modified: trunk/OpenMPT/mptrack/Mptrack.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Mptrack.cpp 2015-03-28 01:04:29 UTC (rev 4907)
+++ trunk/OpenMPT/mptrack/Mptrack.cpp 2015-03-28 19:50:09 UTC (rev 4908)
@@ -158,9 +158,11 @@
CMainFrame::GetMainFrame()->UpdateTree(modDoc, GeneralHint().General());
// Reset edit history for template files
- modDoc->GetrSoundFile().GetFileHistory().clear();
- modDoc->GetrSoundFile().m_dwCreatedWithVersion = MptVersion::num;
- modDoc->GetrSoundFile().m_dwLastSavedWithVersion = 0;
+ CSoundFile &sndFile = modDoc->GetrSoundFile();
+ sndFile.GetFileHistory().clear();
+ sndFile.m_dwCreatedWithVersion = MptVersion::num;
+ sndFile.m_dwLastSavedWithVersion = 0;
+ sndFile.madeWithTracker.clear();
} else
{
// Remove extension from title, so that saving the file will not suggest a filename like e.g. "example.it.it".
@@ -1803,7 +1805,7 @@
if(!dialogShown && GetTickCount() >= scanStart + 2000)
{
- // If this is taking too long, show the user what he's waiting for.
+ // If this is taking too long, show the user what they're waiting for.
dialogShown = true;
pluginScanDlg.Create(IDD_SCANPLUGINS, gpSplashScreen);
pluginScanDlg.ShowWindow(SW_SHOW);
Modified: trunk/OpenMPT/mptrack/View_tre.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_tre.cpp 2015-03-28 01:04:29 UTC (rev 4907)
+++ trunk/OpenMPT/mptrack/View_tre.cpp 2015-03-28 19:50:09 UTC (rev 4908)
@@ -1547,10 +1547,27 @@
break;
case MODITEM_PATTERN:
- wsprintf(s, _T("Remove pattern %u?"), modItemID);
- if(Reporting::Confirm(s, false, true) == cnfYes && modDoc->RemovePattern((PATTERNINDEX)modItemID))
{
- modDoc->UpdateAllViews(nullptr, PatternHint((PATTERNINDEX)modItemID).Data().Names());
+ CSoundFile &sndFile = modDoc->GetrSoundFile();
+ bool isUsed = false;
+ // First, find all used patterns in all sequences.
+ for(SEQUENCEINDEX seq = 0; seq < sndFile.Order.GetNumSequences(); seq++)
+ {
+ const ORDERINDEX ordLength = sndFile.Order.GetSequence(seq).GetLength();
+ for(ORDERINDEX ord = 0; ord < ordLength; ord++)
+ {
+ if(sndFile.Order.GetSequence(seq)[ord] == modItemID)
+ {
+ isUsed = true;
+ break;
+ }
+ }
+ }
+ wsprintf(s, _T("Remove pattern %u?\nThis pattern is currently%s used."), modItemID, isUsed ? _T("") : _T(" not"));
+ if(Reporting::Confirm(s, false, isUsed) == cnfYes && modDoc->RemovePattern((PATTERNINDEX)modItemID))
+ {
+ modDoc->UpdateAllViews(nullptr, PatternHint((PATTERNINDEX)modItemID).Data().Names());
+ }
}
break;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2015-04-09 18:55:34
|
Revision: 4918
http://sourceforge.net/p/modplug/code/4918
Author: saga-games
Date: 2015-04-09 18:55:21 +0000 (Thu, 09 Apr 2015)
Log Message:
-----------
[Mod] Sample tab: Finetune adjustment uses cents instead of Hertz now.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Ctrl_smp.cpp
trunk/OpenMPT/mptrack/mptrack.rc
Modified: trunk/OpenMPT/mptrack/Ctrl_smp.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2015-04-07 19:41:33 UTC (rev 4917)
+++ trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2015-04-09 18:55:21 UTC (rev 4918)
@@ -540,8 +540,8 @@
if ((m_sndFile.GetType() & (MOD_TYPE_XM | MOD_TYPE_MOD)) && (m_nSample))
{
const ModSample &sample = m_sndFile.GetSample(m_nSample);
- UINT nFreqHz = ModSample::TransposeToFrequency(sample.RelativeTone, sample.nFineTune);
- wsprintf(pszText, _T("%luHz"), nFreqHz);
+ uint32 freqHz = ModSample::TransposeToFrequency(sample.RelativeTone, sample.nFineTune);
+ wsprintf(pszText, _T("%luHz"), freqHz);
return TRUE;
}
break;
@@ -629,7 +629,7 @@
// Finetune / C-5 Speed / BaseNote
b = (m_sndFile.GetType() & (MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_MPT)) ? TRUE : FALSE;
- SetDlgItemText(IDC_TEXT7, (b) ? "Freq. (Hz)" : "Finetune");
+ SetDlgItemText(IDC_TEXT7, (b) ? _T("Freq. (Hz)") : _T("Finetune"));
m_SpinFineTune.SetRange(-1, 1);
m_EditFileName.EnableWindow(b);
@@ -676,13 +676,13 @@
SetCurrentSample(m_sndFile.GetNumSamples());
}
const ModSample &sample = m_sndFile.GetSample(m_nSample);
- CHAR s[128];
+ TCHAR s[128];
DWORD d;
m_SpinSample.SetRange(1, m_sndFile.GetNumSamples());
// Length / Type
- wsprintf(s, "%u-bit %s, len: %u", sample.GetElementarySampleSize() * 8, sample.uFlags[CHN_STEREO] ? "stereo" : "mono", sample.nLength);
+ wsprintf(s, _T("%u-bit %s, len: %u"), sample.GetElementarySampleSize() * 8, sample.uFlags[CHN_STEREO] ? _T("stereo") : _T("mono"), sample.nLength);
SetDlgItemText(IDC_TEXT5, s);
// Name
mpt::String::Copy(s, m_sndFile.m_szNames[m_nSample]);
@@ -708,7 +708,7 @@
int transp = 0;
if (m_sndFile.GetType() & (MOD_TYPE_S3M | MOD_TYPE_IT | MOD_TYPE_MPT))
{
- wsprintf(s, "%lu", sample.nC5Speed);
+ wsprintf(s, _T("%lu"), sample.nC5Speed);
m_EditFineTune.SetWindowText(s);
if(sample.nC5Speed != 0)
transp = ModSample::FrequencyToTranspose(sample.nC5Speed) >> 7;
@@ -755,17 +755,17 @@
if (sample.uFlags[CHN_LOOP]) d = sample.uFlags[CHN_PINGPONGLOOP] ? 2 : 1;
if (sample.uFlags[CHN_REVERSE]) d |= 4;
m_ComboLoopType.SetCurSel(d);
- wsprintf(s, "%lu", sample.nLoopStart);
+ wsprintf(s, _T("%lu"), sample.nLoopStart);
m_EditLoopStart.SetWindowText(s);
- wsprintf(s, "%lu", sample.nLoopEnd);
+ wsprintf(s, _T("%lu"), sample.nLoopEnd);
m_EditLoopEnd.SetWindowText(s);
// Sustain Loop
d = 0;
if (sample.uFlags[CHN_SUSTAINLOOP]) d = sample.uFlags[CHN_PINGPONGSUSTAIN] ? 2 : 1;
m_ComboSustainType.SetCurSel(d);
- wsprintf(s, "%lu", sample.nSustainStart);
+ wsprintf(s, _T("%lu"), sample.nSustainStart);
m_EditSustainStart.SetWindowText(s);
- wsprintf(s, "%lu", sample.nSustainEnd);
+ wsprintf(s, _T("%lu"), sample.nSustainEnd);
m_EditSustainEnd.SetWindowText(s);
}
if (hintType[HINT_MODTYPE | HINT_SAMPLEINFO | HINT_SMPNAMES])
@@ -2986,8 +2986,7 @@
{
uint32 d = sample.nC5Speed;
if (d < 1) d = 8363;
- if(d < TrackerSettings::Instance().m_nFinetuneStep) d = TrackerSettings::Instance().m_nFinetuneStep;
- d += (pos * TrackerSettings::Instance().m_nFinetuneStep);
+ d = Util::Round<uint32>(d * std::pow(2.0, (pos * TrackerSettings::Instance().m_nFinetuneStep) / 1200.0));
sample.nC5Speed = Clamp(d, 1u, 9999999u); // 9999999 is max. in Impulse Tracker
int transp = ModSample::FrequencyToTranspose(sample.nC5Speed) >> 7;
int basenote = (NOTE_MIDDLEC - NOTE_MIN) + transp;
Modified: trunk/OpenMPT/mptrack/mptrack.rc
===================================================================
--- trunk/OpenMPT/mptrack/mptrack.rc 2015-04-07 19:41:33 UTC (rev 4917)
+++ trunk/OpenMPT/mptrack/mptrack.rc 2015-04-09 18:55:21 UTC (rev 4918)
@@ -147,7 +147,7 @@
LTEXT "%",IDC_UNDOSIZE,162,20,114,16
LTEXT "Frequency Finetune Steps:",IDC_STATIC,12,38,114,8
EDITTEXT IDC_EDIT_FINETUNE,114,36,42,12,ES_AUTOHSCROLL | ES_NUMBER
- LTEXT "Hz",IDC_STATIC,162,38,30,8
+ LTEXT "Cents",IDC_STATIC,162,38,20,8
LTEXT "Default Sample Format:",IDC_STATIC,12,56,102,8
COMBOBOX IDC_DEFAULT_FORMAT,114,54,42,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
LTEXT "FLAC Compression Level:",IDC_STATIC,12,74,90,8
@@ -2557,6 +2557,10 @@
ID_VIEW_EDITHISTORY "View the edit history of this module"
ID_SAMPLE_GRID "Configure Sample Grid"
ID_FILE_SAVEASTEMPLATE "Save the active document as template module\nSave as Template"
+END
+
+STRINGTABLE
+BEGIN
ID_ENVELOPE_LOAD "Load instrument envelope from file"
ID_ENVELOPE_SAVE "Save instrument envelope to file"
END
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2015-04-09 19:37:35
|
Revision: 4919
http://sourceforge.net/p/modplug/code/4919
Author: saga-games
Date: 2015-04-09 19:37:22 +0000 (Thu, 09 Apr 2015)
Log Message:
-----------
[Fix] Make finetune also work again when decrementing pitch, and define a saner default for the finetune step
Modified Paths:
--------------
trunk/OpenMPT/mptrack/TrackerSettings.cpp
trunk/OpenMPT/mptrack/TrackerSettings.h
Modified: trunk/OpenMPT/mptrack/TrackerSettings.cpp
===================================================================
--- trunk/OpenMPT/mptrack/TrackerSettings.cpp 2015-04-09 18:55:21 UTC (rev 4918)
+++ trunk/OpenMPT/mptrack/TrackerSettings.cpp 2015-04-09 19:37:22 UTC (rev 4919)
@@ -218,7 +218,7 @@
, m_SampleUndoBufferSize(conf, "Sample Editor", "UndoBufferSize", SampleUndoBufferSize())
, sampleEditorKeyBehaviour(conf, "Sample Editor", "KeyBehaviour", seNoteOffOnNewKey)
, m_defaultSampleFormat(conf, "Sample Editor", "DefaultFormat", dfFLAC)
- , m_nFinetuneStep(conf, "Sample Editor", "FinetuneStep", 25)
+ , m_nFinetuneStep(conf, "Sample Editor", "FinetuneStep", 10)
, m_FLACCompressionLevel(conf, "Sample Editor", "FLACCompressionLevel", 5)
, compressITI(conf, "Sample Editor", "CompressITI", true)
, m_MayNormalizeSamplesOnLoad(conf, "Sample Editor", "MayNormalizeSamplesOnLoad", true)
@@ -445,6 +445,7 @@
m_LatencyMS = m_BufferLength_DEPRECATED * 3;
m_UpdateIntervalMS = m_BufferLength_DEPRECATED / 8;
}
+ if(!m_UpdateIntervalMS) m_UpdateIntervalMS = static_cast<uint32>(SoundDevice::Settings().UpdateInterval * 1000.0);
}
conf.Remove(m_BufferLength_DEPRECATED.GetPath());
}
Modified: trunk/OpenMPT/mptrack/TrackerSettings.h
===================================================================
--- trunk/OpenMPT/mptrack/TrackerSettings.h 2015-04-09 18:55:21 UTC (rev 4918)
+++ trunk/OpenMPT/mptrack/TrackerSettings.h 2015-04-09 19:37:22 UTC (rev 4919)
@@ -190,7 +190,7 @@
// Sample editor preview behaviour
enum SampleEditorKeyBehaviour
{
- seNoteOffOnNewKey,
+ seNoteOffOnNewKey = 0,
seNoteOffOnKeyUp,
seNoteOffOnKeyRestrike,
};
@@ -508,7 +508,7 @@
Setting<SampleUndoBufferSize> m_SampleUndoBufferSize;
Setting<SampleEditorKeyBehaviour> sampleEditorKeyBehaviour;
Setting<SampleEditorDefaultFormat> m_defaultSampleFormat;
- Setting<uint32> m_nFinetuneStep; // Increment finetune by x when using spin control. Default = 25
+ Setting<int32> m_nFinetuneStep; // Increment finetune by x when using spin control. Default = 25 cents
Setting<int32> m_FLACCompressionLevel; // FLAC compression level for saving (0...8)
Setting<bool> compressITI;
Setting<bool> m_MayNormalizeSamplesOnLoad;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|