-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlayer.h
42 lines (35 loc) · 771 Bytes
/
Player.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#pragma once
#ifndef _PLAYER_H_
#define _PLAYER_H_
#define MINIAUDIO_IMPLEMENTATION
#include "Miniaudio.h"
#include <msclr/marshal_cppstd.h>
namespace SAP {
using namespace System;
using namespace System::Diagnostics;
ref class Player
{
public:
Player();
~Player();
void loadFile(String^ path);
void play();
void pause();
bool paused();
bool fileValid();
bool engineValid();
uint64_t getTimeInMiliseconds();
uint64_t getTimeInPcmFrames();
uint64_t getTotalTimeInPcmFrames();
float getTotalTimeInSeconds();
void setTimeInPcmFrames(uint64_t second);
void setVolume(float vol);
private:
ma_result* result;
ma_engine* engine;
ma_sound* sound;
bool engineIsValid = false;
bool fileIsValid = false;
};
}
#endif // !_PLAYER_H_