/* * Copyright (C) 2004-2005 Vadim Berezniker * http://www.kryptolus.com * * 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 2, 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 GNU Make; see the file COPYING. If not, write to * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. * http://www.gnu.org/copyleft/gpl.html * */ #include "stdafx.h" #include "common.h" #include "sabbu.h" #include "gui_main_karaoke.h" extern struct sabbu app; kryEventKaraokeText::kryEventKaraokeText() : m_part_time(NULL), m_is_silence(FALSE), m_is_locked(FALSE), m_is_timed(FALSE), m_marker_start(NULL), m_marker_end(NULL), m_event_prev(NULL), m_event_next(NULL), m_command_prev(NULL), m_command_next(NULL) { ((kryEvent *) this)->SetType(kryEvent::EVENT_KARAOKE_TEXT); this->m_marker_start = KRY_MARKER(kry_marker_new(MARKER_KARAOKE, 10)); this->m_marker_end = (KRY_MARKER(kry_marker_new(MARKER_KARAOKE, 10))); g_signal_connect(G_OBJECT(m_marker_start), "value-changed", G_CALLBACK(kryEventKaraokeText::MarkerStartValueChanged), this); g_signal_connect(G_OBJECT(m_marker_end), "value-changed", G_CALLBACK(kryEventKaraokeText::MarkerEndValueChanged), this); } kryEventKaraokeText::~kryEventKaraokeText() { g_object_unref(G_OBJECT(this->GetMarkerStart())); g_object_unref(G_OBJECT(this->GetMarkerEnd())); } gboolean kryEventKaraokeText::GetIsSilence() { return this->m_is_silence; } void kryEventKaraokeText::SetIsSilence(gboolean val) { this->m_is_silence = val; } gboolean kryEventKaraokeText::GetIsLocked() { return this->m_is_locked; } void kryEventKaraokeText::SetIsLocked(gboolean val) { this->m_is_locked = val; } gboolean kryEventKaraokeText::GetIsTimed() { return this->m_is_timed; } void kryEventKaraokeText::SetIsTimed(gboolean val) { this->m_is_timed = val; } void kryEventKaraokeText::MarkerStartValueChanged(KryMarker *marker, int old_val, kryEventKaraokeText *event) { event->SetStart(kry_marker_get_value(marker)); } KryMarker *kryEventKaraokeText::GetMarkerStart() { return this->m_marker_start; } /*void kryEventKaraokeText::SetMarkerStart(KryMarker *marker) { if(this->m_marker_start) g_signal_handlers_disconnect_by_func(G_OBJECT(this->m_marker_start), (void *) kryEventKaraokeText::MarkerStartValueChanged, this); this->m_marker_start = marker; if(marker) g_signal_connect(G_OBJECT(marker), "value-changed", G_CALLBACK(kryEventKaraokeText::MarkerStartValueChanged), this); }*/ void kryEventKaraokeText::MarkerEndValueChanged(KryMarker *marker, int old_val, kryEventKaraokeText *event) { event->SetEnd(kry_marker_get_value(marker)); } KryMarker *kryEventKaraokeText::GetMarkerEnd() { return this->m_marker_end; } kryEventKaraokeTime *kryEventKaraokeText::GetPartTime() { return this->m_part_time; } void kryEventKaraokeText::SetPartTime(kryEventKaraokeTime *part) { this->m_part_time = part; } kryEventKaraokeText *kryEventKaraokeText::GetEventPrev() { return this->m_event_prev; } void kryEventKaraokeText::SetEventPrev(kryEventKaraokeText *event) { this->m_event_prev = event; } kryEventKaraokeText *kryEventKaraokeText::GetEventNext() { return this->m_event_next; } void kryEventKaraokeText::SetEventNext(kryEventKaraokeText *event) { this->m_event_next = event; } int kryEventKaraokeText::GetDuration() { return this->m_duration; } void kryEventKaraokeText::SetDuration(int duration) { this->m_duration = duration; } char *kryEventKaraokeText::GetText() { return this->m_text; } void kryEventKaraokeText::SetText(char *text) { if(this->m_text) kry_free(this->m_text); this->m_text = kry_strdup(text); } kryEvent *kryEventKaraokeText::GetCommandPrev() { return this->m_command_prev; } void kryEventKaraokeText::SetCommandPrev(kryEvent *part) { this->m_command_prev = part; } kryEvent *kryEventKaraokeText::GetCommandNext() { return this->m_command_next; } void kryEventKaraokeText::SetCommandNext(kryEvent *part) { this->m_command_next = part; } void kryEventKaraokeText::SetKaraokeType(enum karaoke_type type) { this->m_type = type; } enum karaoke_type kryEventKaraokeText::GetKaraokeType() { return this->m_type; }