コード例 #1
0
static GObject *
bt_edit_application_constructor (GType type, guint n_construct_params,
    GObjectConstructParam * construct_params)
{
  GObject *object;

  if (G_UNLIKELY (!singleton)) {
    object =
        G_OBJECT_CLASS (bt_edit_application_parent_class)->constructor (type,
        n_construct_params, construct_params);
    singleton = BT_EDIT_APPLICATION (object);
    g_object_add_weak_pointer (object, (gpointer *) (gpointer) & singleton);

    //GST_DEBUG("<<<");
    GST_INFO ("new edit app instantiated");
    // create or ref the shared ui resources
    singleton->priv->ui_resources = bt_ui_resources_new ();

    // create the interaction controller registry
    singleton->priv->ic_registry = btic_registry_new ();
    btic_registry_start_discovery ();

    // create the playback controllers (we need to create them all as they watch
    // the settings them self)
    singleton->priv->pbc_socket = bt_playback_controller_socket_new ();
    singleton->priv->pbc_ic = bt_playback_controller_ic_new ();

    // create the editor change log
    singleton->priv->change_log = bt_change_log_new ();
    g_signal_connect (singleton->priv->change_log, "notify::can-undo",
        G_CALLBACK (on_changelog_can_undo_changed), (gpointer) singleton);
    // create the audio_session
    singleton->priv->audio_session = bt_audio_session_new ();

    // create main window
    GST_INFO ("new edit app created, app: %" G_OBJECT_REF_COUNT_FMT,
        G_OBJECT_LOG_REF_COUNT (singleton));
    singleton->priv->main_window = bt_main_window_new ();
    gtk_widget_show_all (GTK_WIDGET (singleton->priv->main_window));
    GST_INFO ("new main_window shown");

    // warning: dereferencing type-punned pointer will break strict-aliasing rules
    g_object_add_weak_pointer (G_OBJECT (singleton->priv->main_window),
        (gpointer *) (gpointer) & singleton->priv->main_window);
    GST_INFO ("new edit app created, app: %" G_OBJECT_REF_COUNT_FMT,
        G_OBJECT_LOG_REF_COUNT (singleton));
    //GST_DEBUG(">>>");
  } else {
    object = g_object_ref (singleton);
  }
  return object;
}
コード例 #2
0
ファイル: e-aseq-discoverer.c プロジェクト: Buzztrax/buzztrax
static void
test_setup (void)
{
  int err;

  if ((err = snd_seq_open (&seq, "default", SND_SEQ_OPEN_DUPLEX, 0)) == 0) {
    snd_seq_set_client_name (seq, PACKAGE "-tests");
    snd_seq_create_simple_port (seq, "test-static",
        SND_SEQ_PORT_CAP_READ | SND_SEQ_PORT_CAP_SUBS_READ,
        SND_SEQ_PORT_TYPE_MIDI_GENERIC | SND_SEQ_PORT_TYPE_APPLICATION);
  }

  registry = btic_registry_new ();
  btic_registry_start_discovery ();
}