static void
test_bt_missing_framework_elements_dialog_create (BT_TEST_ARGS)
{
  BT_TEST_START;
  GST_INFO ("-- arrange --");
  GList *missing_elements = NULL;

  // add a space here, so that it cannot be filtered
  missing_elements = g_list_append (missing_elements, "level ");
  missing_elements =
      g_list_append (missing_elements, "-> You will not see any level-meters");

  GST_INFO ("-- act --");
  GtkWidget *dialog =
      GTK_WIDGET (bt_missing_framework_elements_dialog_new (NULL,
          missing_elements));

  GST_INFO ("-- assert --");
  fail_unless (dialog != NULL, NULL);
  gtk_widget_show_all (dialog);
  check_make_widget_screenshot (GTK_WIDGET (dialog), NULL);

  GST_INFO ("-- cleanup --");
  gtk_widget_destroy (dialog);
  BT_TEST_END;
}
// create app and then unconditionally destroy window
static void
test_bt_missing_framework_elements_dialog_create_empty (BT_TEST_ARGS)
{
  BT_TEST_START;
  GST_INFO ("-- arrange --");

  GST_INFO ("-- act --");
  GtkWidget *dialog =
      GTK_WIDGET (bt_missing_framework_elements_dialog_new (NULL, NULL));

  GST_INFO ("-- assert --");
  fail_unless (dialog != NULL, NULL);
  gtk_widget_show_all (dialog);

  GST_INFO ("-- cleanup --");
  gtk_widget_destroy (dialog);
  BT_TEST_END;
}
Exemplo n.º 3
0
/*
 * bt_edit_application_check_missing:
 * @self: the edit application
 *
 * Run gstreamer element checks. If elements are missing, if shows a dialog with
 * element-names and brief description what will not work.
 *
 * Returns: %TRUE is no critical elements are missing
 */
static gboolean
bt_edit_application_check_missing (const BtEditApplication * self)
{
  GList *missing_core_elements, *missing_edit_elements =
      NULL, *missing_elements;
  GList *edit_elements = NULL;
  gboolean res = TRUE, missing = FALSE;

  if ((missing_core_elements = bt_gst_check_core_elements ())) {
    missing = TRUE;
    res = FALSE;
  }
  // TODO(ensonic): check recording 'formats' -> use GstEncodeBin
  edit_elements = g_list_prepend (NULL, "level");
  if ((missing_elements = bt_gst_check_elements (edit_elements))) {
    missing_edit_elements =
        g_list_concat (missing_edit_elements, g_list_copy (missing_elements));
    missing_edit_elements =
        g_list_append (missing_edit_elements,
        _("-> You will not see any level-meters."));
    missing = TRUE;
  }
  g_list_free (edit_elements);
  edit_elements = g_list_prepend (NULL, "spectrum");
  if ((missing_elements = bt_gst_check_elements (edit_elements))) {
    missing_edit_elements =
        g_list_concat (missing_edit_elements, g_list_copy (missing_elements));
    missing_edit_elements =
        g_list_append (missing_edit_elements,
        _
        ("-> You will not see the frequency spectrum in the analyzer window."));
    missing = TRUE;
  }
  g_list_free (edit_elements);
  edit_elements = g_list_prepend (NULL, "playbin");
  if ((missing_elements = bt_gst_check_elements (edit_elements))) {
    missing_edit_elements =
        g_list_concat (missing_edit_elements, g_list_copy (missing_elements));
    missing_edit_elements =
        g_list_append (missing_edit_elements,
        _
        ("-> Sample playback previews from the wavetable page will not work."));
    missing = TRUE;
  }
  g_list_free (edit_elements);
  // show missing dialog
  if (missing) {
    GtkWidget *dialog;

    if ((dialog =
            GTK_WIDGET (bt_missing_framework_elements_dialog_new
                (missing_core_elements, missing_edit_elements)))) {
      bt_edit_application_attach_child_window (self, GTK_WINDOW (dialog));
      gtk_widget_show_all (dialog);

      gtk_dialog_run (GTK_DIALOG (dialog));
      bt_missing_framework_elements_dialog_apply
          (BT_MISSING_FRAMEWORK_ELEMENTS_DIALOG (dialog));
      gtk_widget_destroy (dialog);
    }
  }
  // don't free. its static
  //g_list_free(missing_core_elements);
  g_list_free (missing_edit_elements);
  return res;
}