THEME.H 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. //
  2. // Copyright 2020 Electronic Arts Inc.
  3. //
  4. // TiberianDawn.DLL and RedAlert.dll and corresponding source code is free
  5. // software: you can redistribute it and/or modify it under the terms of
  6. // the GNU General Public License as published by the Free Software Foundation,
  7. // either version 3 of the License, or (at your option) any later version.
  8. // TiberianDawn.DLL and RedAlert.dll and corresponding source code is distributed
  9. // in the hope that it will be useful, but with permitted additional restrictions
  10. // under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
  11. // distributed with this program. You should have received a copy of the
  12. // GNU General Public License along with permitted additional restrictions
  13. // with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
  14. /* $Header: /CounterStrike/THEME.H 1 3/03/97 10:26a Joe_bostic $ */
  15. /***********************************************************************************************
  16. *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
  17. ***********************************************************************************************
  18. * *
  19. * Project Name : Command & Conquer *
  20. * *
  21. * File Name : THEME.H *
  22. * *
  23. * Programmer : Joe L. Bostic *
  24. * *
  25. * Start Date : August 14, 1994 *
  26. * *
  27. * Last Update : August 14, 1994 [JLB] *
  28. * *
  29. *---------------------------------------------------------------------------------------------*
  30. * Functions: *
  31. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  32. #ifndef THEME_H
  33. #define THEME_H
  34. class ThemeClass
  35. {
  36. private:
  37. static char const * Theme_File_Name(ThemeType theme);
  38. int Current; // Handle to current score.
  39. ThemeType Score; // Score number currently being played.
  40. ThemeType Pending; // Score to play next.
  41. typedef struct {
  42. char const * Name; // Filename of score.
  43. int Fullname; // Text number for full score name.
  44. int Scenario; // Scenario when it first becomes available.
  45. int Duration; // Duration of theme in seconds.
  46. bool Normal; // Allowed in normal game play?
  47. bool Repeat; // Always repeat this score?
  48. bool Available; // Is the score available?
  49. int Owner; // What houses are allowed to play this theme (bit field)?
  50. } ThemeControl;
  51. static ThemeControl _themes[THEME_COUNT];
  52. enum {
  53. THEME_DELAY=TIMER_SECOND
  54. };
  55. public:
  56. ThemeClass(void);
  57. ThemeType From_Name(char const * name) const;
  58. ThemeType Next_Song(ThemeType index) const;
  59. ThemeType What_Is_Playing(void) const {return Score;}
  60. bool Is_Allowed(ThemeType index) const;
  61. bool Is_Regular(ThemeType theme) const {return(theme != THEME_NONE && _themes[theme].Normal);}
  62. char const * Base_Name(ThemeType index) const;
  63. char const * Full_Name(ThemeType index) const;
  64. int Max_Themes(void) const {return THEME_COUNT;}
  65. int Play_Song(ThemeType index);
  66. int Still_Playing(void) const;
  67. int Track_Length(ThemeType index) const;
  68. static void Scan(void);
  69. void AI(void);
  70. void Fade_Out(void) {Queue_Song(THEME_QUIET);}
  71. void Queue_Song(ThemeType index);
  72. void Set_Theme_Data(ThemeType theme, int scenario, int owners);
  73. void Stop(void);
  74. void Suspend(void);
  75. };
  76. #endif