Side panel added
This commit is contained in:
parent
c7d3b15758
commit
7b325244c5
9 changed files with 366 additions and 25 deletions
29
LibraryViewer/public/WavPlayer.hpp
Normal file
29
LibraryViewer/public/WavPlayer.hpp
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
#pragma once
|
||||
|
||||
#include <iostream>
|
||||
#include <thread>
|
||||
#include <alsa/asoundlib.h>
|
||||
|
||||
class WavPlayer {
|
||||
public:
|
||||
WavPlayer();
|
||||
~WavPlayer();
|
||||
|
||||
void loadSong(const char* filePath);
|
||||
void playSong();
|
||||
void stopSong();
|
||||
void setVolume(float volume);
|
||||
float getProgress() const;
|
||||
float getDurationSec() const;
|
||||
void setProgress(float newProgress);
|
||||
|
||||
private:
|
||||
void playbackThreadFunction();
|
||||
|
||||
snd_pcm_t* handle;
|
||||
std::thread* playbackThread;
|
||||
bool isPlaying;
|
||||
float progress;
|
||||
};
|
||||
|
||||
void example();
|
||||
Loading…
Add table
Add a link
Reference in a new issue