-
Notifications
You must be signed in to change notification settings - Fork 172
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
Sample editor instant feedback #1314
Open
charbeljc
wants to merge
3
commits into
hydrogen-music:development
Choose a base branch
from
charbeljc:sample_editor_instant_feedback
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,43 +28,36 @@ | |
|
||
#include <core/Object.h> | ||
#include "SampleEditor.h" | ||
class SampleEditor; | ||
|
||
class MainSampleWaveDisplay : public QWidget, public H2Core::Object | ||
{ | ||
H2_OBJECT | ||
Q_OBJECT | ||
|
||
public: | ||
|
||
enum Slider { | ||
NONE, | ||
START, | ||
LOOP, | ||
END | ||
}; | ||
|
||
explicit MainSampleWaveDisplay(QWidget* pParent); | ||
~MainSampleWaveDisplay(); | ||
|
||
void updateDisplay( const QString& filename ); | ||
std::shared_ptr<H2Core::Sample> loadSampleAndUpdateDisplay( const QString& filename ); | ||
void updateDisplayPointer(); | ||
|
||
void paintLocatorEvent( int pos, bool last_event); | ||
void paintEvent(QPaintEvent *ev); | ||
|
||
void testPositionFromSampleeditor(); | ||
|
||
int m_nStartFramePosition; | ||
int m_nLoopFramePosition; | ||
int m_nEndFramePosition; | ||
|
||
bool m_bStartSliderIsMoved; | ||
bool m_bLoopSliderIsMoved; | ||
bool m_bEndSliderIsmoved; | ||
|
||
Slider m_SelectedSlider; | ||
SampleEditor::Slider m_SelectedSlider; | ||
|
||
std::shared_ptr<H2Core::Sample> getEditedSample() { return m_pEditedSample; } | ||
|
||
signals: | ||
void doneEditingSlider ( SampleEditor::Slider slider ); | ||
void sliderEdited ( SampleEditor::Slider slider ); | ||
|
||
private: | ||
virtual void mouseMoveEvent(QMouseEvent *ev); | ||
|
@@ -73,11 +66,12 @@ class MainSampleWaveDisplay : public QWidget, public H2Core::Object | |
void testPosition( QMouseEvent *ev ); | ||
void chooseSlider( QMouseEvent *ev ); | ||
void mouseUpdateDone(); | ||
|
||
|
||
std::shared_ptr<H2Core::Sample> m_pEditedSample; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the purpose of this member variable? It's never used. |
||
QPixmap m_background; | ||
int* m_pPeakDatal; | ||
int* m_pPeakDatar; | ||
|
||
int m_nSampleLength; | ||
int m_nLocator; | ||
bool m_bUpdatePosition; | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
How come you removed the
H2Core::Object
in here? It's used for debugging and shouldn't add too much weight.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.
Hum, I was maybe a bit to quick with this. I think EnvelopePoint should go away in favor of a proper Envelope class.
Besides, I have a pending patch which removes the H2Core::Object's overhead...
My point was to get rid of the unique_ptr around EnvelopePoint in envelope, so I can access them from python. I don't remember the details right now, but pybind11 caused me some troubles with those std::shared_ptr<std::unique_ptr> ...
ihmo, EnvelopePoints should be plain dummy structs with copy semantics, and let the (to be written) Envelope let deal with them.
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.
Hi @theGreatWhiteShark I just restored EnvelopePoint inheritance of H2Core::Object.
Regards
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.
Could you split off these changes and make a separate PR? Such fundamental changes in the code base require the consent of at least a majority of all maintainers. This will happen much faster if it's a concise one.
One thing to think about in advance (and I haven't done yet, so, there is a chance none of this makes sense): The envelope in the sample editor is quite similar to the automation path. Maybe there could be a common basis.
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.
Yes, I will do a separate PR on this.
I will have a look at those automation path. If we could factor out some code, it would be nice.
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.
Please see #1318 and #1319 (this one is extracted from #1313)