-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add power #22
Add power #22
Conversation
PreferencesChartsPowerHeight -> "Height relative to waveforms (%%)" | ||
PreferencesChartsPowerUnitSize -> "Points per pixel" | ||
PreferencesChartsPowerUnitSizeDescription -> "Increase for lower image quality." | ||
PreferencesChartsPowerUnitSizeInvalid -> "Unit size must be greater than or equal to Window size." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
less than
PreferencesChartsPowerHeight -> "波形グラフの高さに対する高さの割合(%%)" | ||
PreferencesChartsPowerUnitSize -> "データポイント/ピクセル" | ||
PreferencesChartsPowerUnitSizeDescription -> "この値を大きくすると、グラフの描画は高速になりますが、品質は低下します。" | ||
PreferencesChartsPowerUnitSizeInvalid -> "データポイント/ピクセルはパワーのウィンドウサイズ以上でなければなりません。" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
以下
PreferencesChartsPowerUnitSizeDescription -> "この値を大きくすると、グラフの描画は高速になりますが、品質は低下します。" | ||
PreferencesChartsPowerUnitSizeInvalid -> "データポイント/ピクセルはパワーのウィンドウサイズ以上でなければなりません。" | ||
PreferencesChartsPowerWindowSize -> "パワーのウィンドウサイズ" | ||
PreferencesChartsPowerWindowSizeInvalid -> "パワーのウィンドウサイズはデータポイント/ピクセル以下でなければなりません。" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
以上
PreferencesChartsPowerUnitSizeDescription -> "Increase for lower image quality." | ||
PreferencesChartsPowerUnitSizeInvalid -> "Unit size must be greater than or equal to Window size." | ||
PreferencesChartsPowerWindowSize -> "Window size" | ||
PreferencesChartsPowerWindowSizeInvalid -> "Window size must be less than or equal to Unit size." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
greater than
infoMap[moduleName to sampleFile.name]?.let { | ||
if (it.maxSampleRate == maxSampleRate && | ||
it.normalize == normalize && | ||
it.getFile(project).exists() && | ||
it.lastModified == sampleFile.lastModified() | ||
it.lastModified == sampleFile.lastModified() && | ||
((mergeChannels && it.powerChannels == 1) || (!mergeChannels && it.channels == it.powerChannels)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably we will need to check hasPower
and hasSpectrogram
as well?
We can have a member function in SampleInfo
class to handle this logic.
fun shouldReload(appConf: AppConf, algorithmVersion: Int, ...): Boolean = ...
@@ -186,7 +186,8 @@ class EditorState( | |||
val updated = chartStore.prepareForNewLoading(project, appConf, it) | |||
appState.updateProjectOnLoadedSample(it, moduleName) | |||
if (updated) { | |||
val renderProgressTotal = it.chunkCount * (it.channels + if (it.hasSpectrogram) 1 else 0) | |||
val renderProgressTotal = it.chunkCount * | |||
(it.channels + (if (it.hasSpectrogram) 1 else 0) + (if (it.hasPower) it.powerChannels else 0)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to update totalCharts
in ChartPrerenderer.kt L72
as well. Since the logic is the same, we can have a property in SampleInfo
:
val SampleInfo.totalChartCount: Int get() = ...
@@ -63,7 +65,11 @@ object SampleInfoRepository { | |||
existingInfo.normalize == normalize && | |||
existingInfo.maxSampleRate == maxSampleRate && | |||
existingInfo.getFile(project).exists() && | |||
existingInfo.lastModified == sampleFile.lastModified() | |||
existingInfo.lastModified == sampleFile.lastModified() && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as the comment above
Add power (dB) for #5.