|
From: <sag...@us...> - 2012-11-19 21:42:48
|
Revision: 1433
http://modplug.svn.sourceforge.net/modplug/?rev=1433&view=rev
Author: saga-games
Date: 2012-11-19 21:42:41 +0000 (Mon, 19 Nov 2012)
Log Message:
-----------
[Imp] Sample Editor: When triggering a note, the note frequency is displayed next to the note name in the status bar.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/View_smp.cpp
Modified: trunk/OpenMPT/mptrack/View_smp.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_smp.cpp 2012-11-17 17:28:39 UTC (rev 1432)
+++ trunk/OpenMPT/mptrack/View_smp.cpp 2012-11-19 21:42:41 UTC (rev 1433)
@@ -1525,7 +1525,7 @@
}
}
- if (m_dwBeginSel >= m_dwEndSel)
+ if(m_dwBeginSel >= m_dwEndSel)
{
if (sample.uFlags & CHN_16BIT) ::AppendMenu(hMenu, MF_STRING, ID_SAMPLE_8BITCONVERT, "Convert to 8-bit");
if (sample.uFlags & CHN_STEREO) ::AppendMenu(hMenu, MF_STRING, ID_SAMPLE_MONOCONVERT, "Convert to mono");
@@ -2068,11 +2068,11 @@
{
CModDoc *pModDoc = GetDocument();
BeginWaitCursor();
- if ((pModDoc) && (m_nSample <= pModDoc->GetNumSamples()))
+ if(pModDoc != nullptr && (m_nSample <= pModDoc->GetNumSamples()))
{
CSoundFile *pSndFile = pModDoc->GetSoundFile();
ModSample &sample = pSndFile->GetSample(m_nSample);
- if ((sample.uFlags & CHN_STEREO) && (sample.pSample) && (sample.nLength))
+ if(sample.GetNumChannels() > 1&& sample.pSample != nullptr && sample.nLength != 0)
{
pModDoc->GetSampleUndo().PrepareUndo(m_nSample, sundo_replace);
if(ctrlSmp::ConvertToMono(sample, pSndFile))
@@ -2188,7 +2188,14 @@
m_dwStatus |= SMPSTATUS_KEYDOWN;
s[0] = 0;
- if ((note) && (note <= NOTE_MAX)) wsprintf(s, "%s%d", szNoteNames[(note-1)%12], (note-1)/12);
+ if(ModCommand::IsNote(note))
+ {
+ CSoundFile *pSndFile = pModDoc->GetSoundFile();
+ ModSample &sample = pSndFile->GetSample(m_nSample);
+ uint32 freq = pSndFile->GetFreqFromPeriod(pSndFile->GetPeriodFromNote(note + sample.RelativeTone, sample.nFineTune, sample.nC5Speed), sample.nC5Speed, 0);
+
+ wsprintf(s, "%s%d (%d Hz)", szNoteNames[(note - 1) % 12], (note - 1) / 12, freq);
+ }
pMainFrm->SetInfoText(s);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|