/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#+
#+     Internet Radio Automation & Encoding Toolkit
#+
#+     Copyright (C) 2018, 2019, 2020, 2021 by Kevin C. O'Kane
#+
#+     Kevin C. O'Kane
#+     kc.okane@gmail.com
#+     https://www.cs.uni.edu/~okane
#+     https://threadsafebooks.com/
#+
#+ This program is free software; you can redistribute it and/or modify
#+ it under the terms of the GNU General Public License as published by
#+ the Free Software Foundation; either version 2 of the License, or
#+ (at your option) any later version.
#+
#+ This program is distributed in the hope that it will be useful,
#+ but WITHOUT ANY WARRANTY; without even the implied warranty of
#+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#+ GNU General Public License for more details.
#+
#+ You should have received a copy of the GNU General Public License
#+ along with this program; if not, write to the Free Software
#+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#+
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/

//	Nov 4, 2022

#include "includes.h"
#include "common-externs.h"

#define SLASH '/'

void	frequency_marks(cairo_t *cr) {

//-------------------------------
//	location of freq marks
//-------------------------------

	cairo_set_font_size(cr,12.0);

	if (style == VERY_NARROW_SPECTRUM) {

		cairo_set_source_rgb(cr, 1.0, 1.0, 1.0); // white

		cairo_move_to (cr, G_OFF_FREQ + 1.0, SPECTRUM_FREQ_VERTICAL ); // top
		cairo_show_text(cr, "kHz");
		cairo_stroke (cr);

		cairo_move_to (cr, G_OFF_FREQ + 13. * bar_space, SPECTRUM_FREQ_VERTICAL ); // top
		cairo_show_text(cr, "1");
		cairo_stroke (cr);

		cairo_move_to (cr, G_OFF_FREQ + 37.5 * bar_space, SPECTRUM_FREQ_VERTICAL ); // top
		cairo_show_text(cr, "3");
		cairo_stroke (cr);

		cairo_move_to (cr, G_OFF_FREQ + 62.5 * bar_space, SPECTRUM_FREQ_VERTICAL ); // top
		cairo_show_text(cr, "5");
		cairo_stroke (cr);

		cairo_move_to (cr, G_OFF_FREQ + 95.0 * bar_space, SPECTRUM_FREQ_VERTICAL ); // top
		cairo_show_text(cr, "7");
		cairo_stroke (cr);

		return ;
		}

	if (style == NARROW_SPECTRUM )  { // narrow

		cairo_set_source_rgb(cr, 1.0, 1.0, 1.0); // white

		cairo_move_to (cr, G_OFF_FREQ + 1.0, SPECTRUM_FREQ_VERTICAL ); // top
		cairo_show_text(cr, "kHz");
		cairo_stroke (cr);

		cairo_move_to (cr, G_OFF_FREQ + 38.0 / 4.0 * bar_space, SPECTRUM_FREQ_VERTICAL ); // top
		cairo_show_text(cr, "1");
		cairo_stroke (cr);

		cairo_move_to (cr, G_OFF_FREQ + 88.0 / 4.0 * bar_space, SPECTRUM_FREQ_VERTICAL ); // top
		cairo_show_text(cr, "2.5");
		cairo_stroke (cr);

		cairo_move_to (cr, G_OFF_FREQ + 185.0 / 4.0 * bar_space, SPECTRUM_FREQ_VERTICAL ); // top
		cairo_show_text(cr, "5");
		cairo_stroke (cr);

		cairo_move_to (cr, G_OFF_FREQ + 270.0 / 4.0 * bar_space, SPECTRUM_FREQ_VERTICAL ); // top
		cairo_show_text(cr, "7.5");
		cairo_stroke (cr);

		cairo_move_to (cr, G_OFF_FREQ + 360.0 / 4.0 * bar_space, SPECTRUM_FREQ_VERTICAL ); // top
		cairo_show_text(cr, "10");
		cairo_stroke (cr);

		return ;
		}

	else if (style == WIDE_SPECTRUM) {
		cairo_set_source_rgb(cr, 1.2, 1.2, 1.0); // gray

		cairo_move_to (cr, G_OFF_FREQ + 1.0, SPECTRUM_FREQ_VERTICAL ); // top
		cairo_show_text(cr, "kHz");
		cairo_stroke (cr);

		cairo_move_to (cr, G_OFF_FREQ + 40.0 / 4.0 * bar_space, SPECTRUM_FREQ_VERTICAL ); // top
		cairo_show_text(cr, "2.5");
		cairo_stroke (cr);

		cairo_move_to (cr, G_OFF_FREQ + 88.0 / 4.0 * bar_space, SPECTRUM_FREQ_VERTICAL ); // top
		cairo_show_text(cr, "5");
		cairo_stroke (cr);

		cairo_move_to (cr, G_OFF_FREQ + 130.0 / 4.0 * bar_space, SPECTRUM_FREQ_VERTICAL ); // top
		cairo_show_text(cr, "7.5");
		cairo_stroke (cr);

		cairo_move_to (cr, G_OFF_FREQ + 176.0 / 4.0 * bar_space, SPECTRUM_FREQ_VERTICAL ); // top
		cairo_show_text(cr, "10");
		cairo_stroke (cr);

		cairo_move_to (cr, G_OFF_FREQ + 270.0 / 4.0 * bar_space, SPECTRUM_FREQ_VERTICAL ); // top
		cairo_show_text(cr, "15");
		cairo_stroke (cr);

		cairo_move_to (cr, G_OFF_FREQ + 360.0 / 4.0 * bar_space, SPECTRUM_FREQ_VERTICAL ); // top
		cairo_show_text(cr, "20");
		cairo_stroke (cr);

		}
	}
