exposurses

Check-in [8669035245]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Whitespace changes for consistent formatting
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 8669035245e658b84bb825e79bbd2f6d442dd9149331be353ba97dafcc9df090
User & Date: base@atomicules.co.uk 2013-08-24 15:53:59
Context
2013-08-25
21:50
Makes the basic menu interaction work (select 2, set other) Track the selected values, but for now still do the dummy row shift thing. check-in: 10d5131043 user: base@atomicules.co.uk tags: origin/master, trunk
2013-08-24
15:53
Whitespace changes for consistent formatting check-in: 8669035245 user: base@atomicules.co.uk tags: origin/master, trunk
15:52
Ensure two different menus have been selected before executing check-in: 5f0ed62195 user: base@atomicules.co.uk tags: origin/master, trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to exposurses.c.

55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
..
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
...
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
...
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
...
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
void selection(char *name);
void print_in_middle(WINDOW *win, int starty, int startx, int width, char *string, chtype color);
int exposure(int iso);
int selection_counter;
double shutter(int exposure, int aperture);
double aperture(int exposure, int shutter);

int main(){
	int c;
	MENU **menu;
	WINDOW **win;
	int n_iso, i;
	int n_shutter, j;
	int n_aperture, k;
    int menu_counter;
................................................................................
	n_aperture = ARRAY_SIZE(aperture_array);
	iso_items = (ITEM **)calloc(n_iso, sizeof(ITEM *));
	for(i = 0; i < n_iso; ++i) {
		iso_items[i] = new_item(iso_array[i], iso_array[i]);
		set_item_userptr(iso_items[i], selection);
	}
	shutter_items = (ITEM **)calloc(n_shutter, sizeof(ITEM *));
	for(i = 0; i < n_shutter; ++i){
		shutter_items[i] = new_item(shutter_array[i], shutter_array[i]);
		set_item_userptr(shutter_items[i], selection);
	}
	aperture_items = (ITEM **)calloc(n_aperture, sizeof(ITEM *));
	for(i = 0; i < n_aperture; ++i){
		aperture_items[i] = new_item(aperture_array[i], aperture_array[i]);
		set_item_userptr(aperture_items[i], selection);
	}

	/* Create menu */
	iso_menu = new_menu((ITEM **)iso_items);
	shutter_menu = new_menu((ITEM **)shutter_items);
................................................................................
	attroff(COLOR_PAIR(2));
	refresh();

    /* set default menu */
    menu = &iso_menu;
    win = &iso_win;

	while((c = getch())){
		switch(c){
			case KEY_LEFT:
                if (menu_counter > 1)
                    menu_counter -= 1;
                switch(menu_counter){
                    case 1:
                        menu = &iso_menu;
                        win = &iso_win;
                        break;
                    case 2:
                        menu = &shutter_menu;
                        win = &shutter_win;
................................................................................
                        break;
                    break;
                }
			    break;
			case KEY_RIGHT:
                if (menu_counter < 3)
                    menu_counter += 1;
                switch(menu_counter){
                    case 1:
                        menu = &iso_menu;
                        win = &iso_win;
                        break;
                    case 2:
                        menu = &shutter_menu;
                        win = &shutter_win;
................................................................................
	for(i = 0; i < n_shutter; ++i)
		free_item(shutter_items[i]);
	for(i = 0; i < n_aperture; ++i)
		free_item(aperture_items[i]);
	endwin();
}

void print_in_middle(WINDOW *win, int starty, int startx, int width, char *string, chtype color){
	int length, x, y;
	float temp;

	if(win == NULL)
		win = stdscr;
	getyx(win, y, x);
	if(startx != 0)







|







 







|




|







 







|
|



|







 







|







 







|







55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
..
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
...
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
...
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
...
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
void selection(char *name);
void print_in_middle(WINDOW *win, int starty, int startx, int width, char *string, chtype color);
int exposure(int iso);
int selection_counter;
double shutter(int exposure, int aperture);
double aperture(int exposure, int shutter);

int main() {
	int c;
	MENU **menu;
	WINDOW **win;
	int n_iso, i;
	int n_shutter, j;
	int n_aperture, k;
    int menu_counter;
................................................................................
	n_aperture = ARRAY_SIZE(aperture_array);
	iso_items = (ITEM **)calloc(n_iso, sizeof(ITEM *));
	for(i = 0; i < n_iso; ++i) {
		iso_items[i] = new_item(iso_array[i], iso_array[i]);
		set_item_userptr(iso_items[i], selection);
	}
	shutter_items = (ITEM **)calloc(n_shutter, sizeof(ITEM *));
	for(i = 0; i < n_shutter; ++i) {
		shutter_items[i] = new_item(shutter_array[i], shutter_array[i]);
		set_item_userptr(shutter_items[i], selection);
	}
	aperture_items = (ITEM **)calloc(n_aperture, sizeof(ITEM *));
	for(i = 0; i < n_aperture; ++i) {
		aperture_items[i] = new_item(aperture_array[i], aperture_array[i]);
		set_item_userptr(aperture_items[i], selection);
	}

	/* Create menu */
	iso_menu = new_menu((ITEM **)iso_items);
	shutter_menu = new_menu((ITEM **)shutter_items);
................................................................................
	attroff(COLOR_PAIR(2));
	refresh();

    /* set default menu */
    menu = &iso_menu;
    win = &iso_win;

	while((c = getch())) {
		switch(c) {
			case KEY_LEFT:
                if (menu_counter > 1)
                    menu_counter -= 1;
                switch(menu_counter) {
                    case 1:
                        menu = &iso_menu;
                        win = &iso_win;
                        break;
                    case 2:
                        menu = &shutter_menu;
                        win = &shutter_win;
................................................................................
                        break;
                    break;
                }
			    break;
			case KEY_RIGHT:
                if (menu_counter < 3)
                    menu_counter += 1;
                switch(menu_counter) {
                    case 1:
                        menu = &iso_menu;
                        win = &iso_win;
                        break;
                    case 2:
                        menu = &shutter_menu;
                        win = &shutter_win;
................................................................................
	for(i = 0; i < n_shutter; ++i)
		free_item(shutter_items[i]);
	for(i = 0; i < n_aperture; ++i)
		free_item(aperture_items[i]);
	endwin();
}

void print_in_middle(WINDOW *win, int starty, int startx, int width, char *string, chtype color) {
	int length, x, y;
	float temp;

	if(win == NULL)
		win = stdscr;
	getyx(win, y, x);
	if(startx != 0)