[SCM] kodi-pvr-hts/master: move AsyncState to tvheadend/utilities

tiber-guest at users.alioth.debian.org tiber-guest at users.alioth.debian.org
Wed Mar 2 23:01:54 UTC 2016


The following commit has been merged in the master branch:
commit e327956b9dab49aead42ba7e30ddb45f1623f641
Author: Sam Stenvall <sam.stenvall at nordsoftware.com>
Date:   Sun Jan 3 22:17:12 2016 +0200

    move AsyncState to tvheadend/utilities

diff --git a/CMakeLists.txt b/CMakeLists.txt
index e5fbb79..5c7623b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -16,9 +16,7 @@ include_directories(${kodiplatform_INCLUDE_DIRS}
 add_definitions(-DUSE_DEMUX)
 
 # Sources and headers
-set(HTS_SOURCES src/AsyncState.cpp
-                src/AsyncState.h
-                src/client.h
+set(HTS_SOURCES src/client.h
                 src/client.cpp
                 src/HTSPConnection.cpp
                 src/HTSPDemuxer.cpp
@@ -57,13 +55,15 @@ set(HTS_SOURCES_TVHEADEND_ENTITY
                 src/tvheadend/entity/TimeRecording.cpp)
 
 set(HTS_SOURCES_TVHEADEND_STATUS
-        src/tvheadend/status/Quality.h
-        src/tvheadend/status/QueueStatus.h
-        src/tvheadend/status/SourceInfo.h
-        src/tvheadend/status/TimeshiftStatus.h)
+                src/tvheadend/status/Quality.h
+                src/tvheadend/status/QueueStatus.h
+                src/tvheadend/status/SourceInfo.h
+                src/tvheadend/status/TimeshiftStatus.h)
 
 set(HTS_SOURCES_TVHEADEND_UTILITIES
-				src/tvheadend/utilities/Utilities.h)
+                src/tvheadend/utilities/Utilities.h
+                src/tvheadend/utilities/AsyncState.cpp
+                src/tvheadend/utilities/AsyncState.h)
                 
 source_group("Source Files" FILES ${HTS_SOURCES})
 source_group("Source Files\\tvheadend" FILES ${HTS_SOURCES_TVHEADEND})
diff --git a/src/AsyncState.h b/src/AsyncState.h
deleted file mode 100644
index 4d8bfd4..0000000
--- a/src/AsyncState.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- *      Copyright (C) 2005-2014 Team XBMC
- *      http://www.xbmc.org
- *
- *  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 XBMC; 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
- *
- */
-
-#ifndef ASYNCSTATE_H
-#define	ASYNCSTATE_H
-
-#include "platform/threads/mutex.h"
-
-/**
- * Represents the possible states
- */
-enum eAsyncState
-{
-  ASYNC_NONE = 0,
-  ASYNC_CHN = 1,
-  ASYNC_DVR = 2,
-  ASYNC_EPG = 3,
-  ASYNC_DONE = 4
-};
-
-/**
- * State tracker for the initial sync process. This class is thread-safe.
- */
-class AsyncState
-{
-public:
-  AsyncState(int timeout);
-
-  virtual ~AsyncState()
-  {
-  };
-
-  /**
-   * @return the current state
-   */
-  eAsyncState GetState();
-
-  /**
-   * Changes the current state to "state"
-   * @param state the new state
-   */
-  void SetState(eAsyncState state);
-
-  /**
-   * Waits for the current state to change into "state" or higher
-   * before the timeout is reached
-   * @param state the minimum state desired
-   * @return whether the state changed or not
-   */
-  bool WaitForState(eAsyncState state);
-
-private:
-
-  static bool PredicateCallback ( void *param );
-  
-  eAsyncState m_state;
-  PLATFORM::CMutex m_mutex;
-  PLATFORM::CCondition<bool> m_condition;
-  int m_timeout;
-
-};
-
-#endif	/* ASYNCSTATE_H */
-
diff --git a/src/Tvheadend.h b/src/Tvheadend.h
index a73a7fc..5cb9089 100644
--- a/src/Tvheadend.h
+++ b/src/Tvheadend.h
@@ -31,7 +31,6 @@
 #include "kodi/libXBMC_addon.h"
 #include "tvheadend/Settings.h"
 #include "HTSPTypes.h"
-#include "AsyncState.h"
 #include "tvheadend/ChannelTuningPredictor.h"
 #include "tvheadend/Profile.h"
 #include "tvheadend/entity/Tag.h"
@@ -42,6 +41,7 @@
 #include "tvheadend/status/Quality.h"
 #include "tvheadend/status/SourceInfo.h"
 #include "tvheadend/status/TimeshiftStatus.h"
+#include "tvheadend/utilities/AsyncState.h"
 #include "tvheadend/Subscription.h"
 #include "TimeRecordings.h"
 #include "AutoRecordings.h"
@@ -440,7 +440,7 @@ private:
 
   SHTSPEventList              m_events;
 
-  AsyncState                  m_asyncState;
+  tvheadend::utilities::AsyncState  m_asyncState;
 
   TimeRecordings              m_timeRecordings;
   AutoRecordings              m_autoRecordings;
diff --git a/src/AsyncState.cpp b/src/tvheadend/utilities/AsyncState.cpp
similarity index 97%
rename from src/AsyncState.cpp
rename to src/tvheadend/utilities/AsyncState.cpp
index d49e9b5..0c30a93 100644
--- a/src/AsyncState.cpp
+++ b/src/tvheadend/utilities/AsyncState.cpp
@@ -21,13 +21,14 @@
 
 #include "AsyncState.h"
 
+using namespace tvheadend::utilities;
+using namespace PLATFORM;
+
 struct Param {
   eAsyncState state;
   AsyncState *self;
 };
 
-using namespace PLATFORM;
-
 AsyncState::AsyncState(int timeout)
 {
   m_state   = ASYNC_NONE;
diff --git a/src/tvheadend/utilities/AsyncState.h b/src/tvheadend/utilities/AsyncState.h
new file mode 100644
index 0000000..1d672da
--- /dev/null
+++ b/src/tvheadend/utilities/AsyncState.h
@@ -0,0 +1,86 @@
+/*
+ *      Copyright (C) 2005-2014 Team XBMC
+ *      http://www.xbmc.org
+ *
+ *  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 XBMC; 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
+ *
+ */
+
+#ifndef ASYNCSTATE_H
+#define	ASYNCSTATE_H
+
+#include "platform/threads/mutex.h"
+
+namespace tvheadend {
+  namespace utilities {
+
+    /**
+     * Represents the possible states
+     */
+    enum eAsyncState
+    {
+      ASYNC_NONE = 0,
+      ASYNC_CHN = 1,
+      ASYNC_DVR = 2,
+      ASYNC_EPG = 3,
+      ASYNC_DONE = 4
+    };
+
+    /**
+     * State tracker for the initial sync process. This class is thread-safe.
+     */
+    class AsyncState
+    {
+    public:
+      AsyncState(int timeout);
+
+      virtual ~AsyncState()
+      {
+      };
+
+      /**
+       * @return the current state
+       */
+      eAsyncState GetState();
+
+      /**
+       * Changes the current state to "state"
+       * @param state the new state
+       */
+      void SetState(eAsyncState state);
+
+      /**
+       * Waits for the current state to change into "state" or higher
+       * before the timeout is reached
+       * @param state the minimum state desired
+       * @return whether the state changed or not
+       */
+      bool WaitForState(eAsyncState state);
+
+    private:
+
+      static bool PredicateCallback ( void *param );
+
+      eAsyncState m_state;
+      PLATFORM::CMutex m_mutex;
+      PLATFORM::CCondition<bool> m_condition;
+      int m_timeout;
+
+    };
+  }
+}
+
+#endif	/* ASYNCSTATE_H */

-- 
kodi-pvr-hts packaging



More information about the pkg-multimedia-commits mailing list