File: scoreops.c

package info (click to toggle)
denemo 0.5.9-2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 2,500 kB
  • ctags: 2,415
  • sloc: ansic: 23,057; sh: 3,321; yacc: 1,737; makefile: 449; lex: 376
file content (66 lines) | stat: -rw-r--r-- 1,580 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/* scoreops.c
 * functions dealing with the whole score

 * for Denemo, a gtk+ frontend to GNU Lilypond
 * (c) 2000, 2001 Matthew Hiller */

#include "datastructures.h"
#include "staffops.h"

#define INITIAL_WHOLEWIDTH 160
#define INITIAL_STAFFHEIGHT 100

void
init_score (struct scoreinfo *si)
{
  si->leftmeasurenum = si->rightmeasurenum = 1;
  si->top_staff = si->bottom_staff = 1;
  si->measurewidth = INITIAL_WHOLEWIDTH;
  si->measurewidths = NULL;
  si->staffspace = INITIAL_STAFFHEIGHT;

  si->thescore = NULL;
  si->currentstaffnum = 1;
  si->currentmeasurenum = 1;
  si->currentobject = NULL;
  si->cursor_x = 0;
  si->cursor_y = 0;
  si->staffletter_y = 0;
  si->cursor_appending = TRUE;
  si->rest_mode = FALSE;
  si->cursoroffend = FALSE;
  si->markstaffnum = 0;
  si->markmeasurenum = 0;
  si->markcursor_x = 0;
  si->haschanged = FALSE;
  si->is_grace_mode = FALSE;
  /*playback purposes */
  si->tempo = 60;
  si->start = 0;
  si->end = 0;
  si->stafftoplay = 0;

  si->savebuffer = NULL;

  /* Header info */
  si->title = g_string_new ("");
  si->subtitle = g_string_new ("");
  si->composer = g_string_new ("");
  si->filename = g_string_new ("");
}

void
free_score (struct scoreinfo *si)
{
  si->currentstaff = si->thescore;
  si->currentstaffnum = 1;
  while (removestaff (si, 1, 1))
    ;
  g_list_free (si->measurewidths);
  g_string_free (si->title, FALSE);
  g_string_free (si->subtitle, FALSE);
  g_string_free (si->composer, FALSE);
  g_string_free (si->filename, FALSE);
  gtk_window_set_title (GTK_WINDOW (si->window), "Denemo");
  init_score (si);
}