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 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
|
/*******************************************************************************
* Goggles Audio Player Library *
********************************************************************************
* Copyright (C) 2010-2021 by Sander Jansen. All Rights Reserved *
* --- *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see http://www.gnu.org/licenses. *
********************************************************************************/
#include "ap_defs.h"
#include "ap_event_private.h"
namespace ap {
Event::Event() : next(nullptr), type(AP_INVALID),stream(0) {
}
Event::Event(FXuchar t) : next(nullptr), type(t),stream(0) {
FXASSERT(type!=AP_INVALID);
}
Event::~Event() {
next=nullptr;
}
void Event::unref() {
delete this;
}
void Event::unref(Event*& event) {
event->unref();
event=nullptr;
}
FlushEvent::FlushEvent(FXlong o) : Event(Flush), offset(o), close(false) {
}
FlushEvent::FlushEvent(FXbool c) : Event(Flush), offset(0), close(c) {
}
ControlEvent::ControlEvent(FXuchar t,const FXString & msg) : Event(t),text(msg) {
}
ControlEvent::ControlEvent(FXuchar t,FXuint id) : Event(t) {
stream=id;
}
ControlEvent::~ControlEvent() {
}
ErrorMessage::ErrorMessage(const FXString & text) : Event(AP_ERROR),msg(text) {
}
ErrorMessage::~ErrorMessage() {
}
TimeUpdate::TimeUpdate(FXuint p,FXuint l) : Event(AP_TIMESTAMP), position(p), length(l) {
}
TimeUpdate::~TimeUpdate() {
}
MetaInfo::MetaInfo() : Event(AP_META_INFO) {
}
MetaInfo::~MetaInfo() {
}
VolumeNotify::VolumeNotify() : Event(AP_VOLUME_NOTIFY) {
}
VolumeNotify::VolumeNotify(FXfloat v) : Event(AP_VOLUME_NOTIFY),volume(v) {
}
VolumeNotify::~VolumeNotify() {
}
CtrlSeekEvent::CtrlSeekEvent(FXdouble p) : Event(Ctrl_Seek), pos(p) {
}
CtrlSeekEvent::~CtrlSeekEvent() {
}
CtrlVolumeEvent::CtrlVolumeEvent(FXfloat v) : Event(Ctrl_Volume), vol(v) {
}
CtrlVolumeEvent::~CtrlVolumeEvent() {
}
ConfigureEvent::ConfigureEvent(const AudioFormat & fmt,FXuchar c,FXint n) : Event(Configure),
af(fmt),
codec(c),
stream_length(n),
data(nullptr),
stream_offset_start(0),
stream_offset_end(0){
}
ConfigureEvent::~ConfigureEvent(){
delete dc;
}
}
|