marlin r1347 - trunk/marlin



Author: iain
Date: Sat Dec 27 23:43:03 2008
New Revision: 1347
URL: http://svn.gnome.org/viewvc/marlin?rev=1347&view=rev

Log:
Unref the player and recorder when the program shuts down

Modified:
   trunk/marlin/marlin-jack-record.c
   trunk/marlin/marlin-program.c

Modified: trunk/marlin/marlin-jack-record.c
==============================================================================
--- trunk/marlin/marlin-jack-record.c	(original)
+++ trunk/marlin/marlin-jack-record.c	Sat Dec 27 23:43:03 2008
@@ -159,8 +159,9 @@
 
 	priv = GET_PRIVATE (object);
 
-	free_ports ((MarlinJackRecord *) object);
-	/*jack_client_close (priv->client);*/
+	if (priv->port_data != NULL) {
+		free_ports ((MarlinJackRecord *) object);
+	}
 
 	((GObjectClass *) marlin_jack_record_parent_class)->finalize (object);
 }

Modified: trunk/marlin/marlin-program.c
==============================================================================
--- trunk/marlin/marlin-program.c	(original)
+++ trunk/marlin/marlin-program.c	Sat Dec 27 23:43:03 2008
@@ -88,6 +88,16 @@
 		priv->clipboard = NULL;
 	}
 
+	if (priv->player != NULL) {
+		g_object_unref (G_OBJECT (priv->player));
+		priv->player = NULL;
+	}
+
+	if (priv->recorder != NULL) {
+		g_object_unref (G_OBJECT (priv->recorder));
+		priv->recorder = NULL;
+	}
+
 	G_OBJECT_CLASS (marlin_program_parent_class)->dispose (object);
 }
 
@@ -145,15 +155,6 @@
 	} else {
 		priv->player = marlin_jack_play_new (priv->client);
 		priv->recorder = marlin_jack_record_new (priv->client);
-
-		if (status & JackServerStarted) {
-			g_print ("Jack server started\n");
-		}
-
-		if (status & JackNameNotUnique) {
-			char *client_name = jack_get_client_name (priv->client);
-			g_print ("Unique name %s assigned\n", client_name);
-		}
 	}
 
 	priv->current_owner = MARLIN_PROGRAM_JACK_UNOWNED;
@@ -316,6 +317,17 @@
 
 /**
  * marlin_program_acquire_jack
+ * @program: A #MarlinProgram object
+ * @owner_id: The owner ID that wishes to acquire the Jack objects
+ * @locked: Whether the acquirement should be locked
+ *
+ * Requests that the Jack client be acquired by @owner_id. If the Jack client
+ * is not busy, and the previous owner did not lock the client then @owner_id
+ * will become the new jack owner and the jack-owner-changed signal will be
+ * emitted.
+ * If @locked is TRUE then no other owner will be able to steal ownership from
+ * @owner_id until @owner_id releases the Jack client with
+ * #marlin_program_release_jack.
  */
 void
 marlin_program_acquire_jack (MarlinProgram *program,
@@ -345,6 +357,10 @@
 
 /**
  * marlin_program_release_jack:
+ * @program: A #MarlinProgram object
+ * @owner_id: The owner ID that wishes to release the Jack object
+ *
+ * Releases ownership of the Jack client, emitting the jack-owner-changed signal
  */
 void
 marlin_program_release_jack (MarlinProgram *program,
@@ -364,6 +380,12 @@
 
 /**
  * marlin_program_get_player:
+ * @program: A #MarlinProgram object
+ *
+ * Obtains the jack player.
+ *
+ * Return value: A #MarlinJackPlay object that should be unreffed when finished
+ * with.
  */
 MarlinJack *
 marlin_program_get_player (MarlinProgram *program)
@@ -379,6 +401,12 @@
 
 /**
  * marlin_program_get_recorder:
+ * @program: A #MarlinProgram object
+ *
+ * Obtains the jack recorder.
+ *
+ * Return value: A #MarlinJackRecord object that should be unreffed when
+ * finished with.
  */
 MarlinJack *
 marlin_program_get_recorder (MarlinProgram *program)
@@ -394,7 +422,11 @@
 
 /**
  * marlin_program_get_jack_owner:
- * @program:
+ * @program: A #MarlinProgram object
+ *
+ * Obtains the owner ID of the current Jack owner
+ *
+ * Return value: A guint of the current Jack owner.
  */
 guint
 marlin_program_get_jack_owner (MarlinProgram *program)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]