nux-0.9.48
|
00001 /* 00002 * Copyright (C) 2010 Canonical, Ltd. 00003 * 00004 * This library is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU Lesser General Public License 00006 * version 3.0 as published by the Free Software Foundation. 00007 * 00008 * This library is distributed in the hope that it will be useful, 00009 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00011 * GNU Lesser General Public License version 3.0 for more details. 00012 * 00013 * You should have received a copy of the GNU Lesser General Public 00014 * License along with this library. If not, see 00015 * <http://www.gnu.org/licenses/>. 00016 * 00017 * Authored by Gordon Allott <gord.allott@canonical.com> 00018 */ 00019 00020 #ifndef TIMELINE_H 00021 #define TIMELINE_H 00022 00023 namespace nux 00024 { 00025 class Timeline : public Object 00026 { 00027 public: 00028 00029 Timeline (unsigned int msecs, const TCHAR *Caption, NUX_FILE_LINE_DECL); 00030 ~Timeline(); 00031 00032 void Stop (); 00033 void Start (); 00034 void Pause (); 00035 void Rewind (); 00036 00037 double GetProgress (); //ranges from 0.0 -> 1.0 00038 virtual double GetEasing (); // override to provide easing values 00039 00040 void DoTick (unsigned long msecs); // If you use this, you make baby kittens cry 00041 00042 bool Looping; 00043 unsigned long Duration; 00044 bool IsPlaying; 00045 00046 sigc::signal <void, unsigned long> NewFrame; 00047 sigc::signal <void> Completed; 00048 sigc::signal <void> Started; 00049 sigc::signal <void> Paused; 00050 00051 protected: 00052 unsigned long _ElapsedTime; 00053 }; 00054 } 00055 00056 #endif // TIMELINE_H