Lines Matching refs:file
205 long_title [] = "This is a very long and very boring title for this file",
218 SNDFILE *file ;
231 file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ;
233 /* Write stuff at start of file. */
234 sf_set_string (file, SF_STR_TITLE, filename) ;
235 sf_set_string (file, SF_STR_SOFTWARE, software) ;
236 sf_set_string (file, SF_STR_ARTIST, artist) ;
237 sf_set_string (file, SF_STR_GENRE, genre) ;
238 sf_set_string (file, SF_STR_TRACKNUMBER, trackno) ;
240 /* Write data to file. */
241 test_write_short_or_die (file, 0, data_out, BUFFER_LEN, __LINE__) ;
242 test_seek_or_die (file, 0, SEEK_SET, 0, sfinfo.channels, __LINE__) ;
244 /* Write more stuff at end of file. */
245 sf_set_string (file, SF_STR_COPYRIGHT, copyright) ;
246 sf_set_string (file, SF_STR_COMMENT, comment) ;
247 sf_set_string (file, SF_STR_DATE, date) ;
248 sf_set_string (file, SF_STR_ALBUM, album) ;
249 sf_set_string (file, SF_STR_LICENSE, license) ;
251 sf_close (file) ;
253 file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ;
255 check_log_buffer_or_die (file, __LINE__) ;
262 cptr = sf_get_string (file, SF_STR_TITLE) ;
269 cptr = sf_get_string (file, SF_STR_COPYRIGHT) ;
276 cptr = sf_get_string (file, SF_STR_SOFTWARE) ;
289 cptr = sf_get_string (file, SF_STR_ARTIST) ;
296 cptr = sf_get_string (file, SF_STR_COMMENT) ;
304 { cptr = sf_get_string (file, SF_STR_DATE) ;
311 cptr = sf_get_string (file, SF_STR_GENRE) ;
329 cptr = sf_get_string (file, SF_STR_ALBUM) ;
336 cptr = sf_get_string (file, SF_STR_LICENSE) ;
343 cptr = sf_get_string (file, SF_STR_TRACKNUMBER) ;
354 dump_log_buffer (file) ;
358 sf_close (file) ;
367 SNDFILE *file ;
396 file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ;
398 /* Write stuff at start of file. */
399 sf_set_string (file, SF_STR_TITLE, filename) ;
400 sf_set_string (file, SF_STR_SOFTWARE, software) ;
401 sf_set_string (file, SF_STR_ARTIST, artist) ;
402 sf_set_string (file, SF_STR_COPYRIGHT, copyright) ;
403 sf_set_string (file, SF_STR_COMMENT, comment) ;
404 sf_set_string (file, SF_STR_ALBUM, album) ;
405 sf_set_string (file, SF_STR_LICENSE, license) ;
407 { sf_set_string (file, SF_STR_GENRE, id3v1_genre) ;
408 sf_set_string (file, SF_STR_DATE, year) ;
411 { sf_set_string (file, SF_STR_DATE, date) ;
414 /* Write data to file. */
415 test_write_short_or_die (file, 0, data_out, BUFFER_LEN, __LINE__) ;
417 sf_close (file) ;
419 file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ;
421 check_log_buffer_or_die (file, __LINE__) ;
428 cptr = sf_get_string (file, SF_STR_TITLE) ;
436 { cptr = sf_get_string (file, SF_STR_COPYRIGHT) ;
443 cptr = sf_get_string (file, SF_STR_SOFTWARE) ;
458 { cptr = sf_get_string (file, SF_STR_GENRE) ;
466 cptr = sf_get_string (file, SF_STR_ARTIST) ;
473 cptr = sf_get_string (file, SF_STR_COMMENT) ;
487 cptr = sf_get_string (file, SF_STR_DATE) ;
496 cptr = sf_get_string (file, SF_STR_DATE) ;
506 { cptr = sf_get_string (file, SF_STR_ALBUM) ;
523 cptr = sf_get_string (file, SF_STR_LICENSE) ;
533 dump_log_buffer (file) ;
537 sf_close (file) ;
552 SNDFILE *file ;
565 file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ;
567 /* Write stuff at start of file. */
568 sf_set_string (file, SF_STR_TITLE, title) ;
569 sf_set_string (file, SF_STR_SOFTWARE, software) ;
570 sf_set_string (file, SF_STR_ARTIST, artist) ;
572 /* Write data to file. */
573 test_write_short_or_die (file, 0, data_out, BUFFER_LEN, __LINE__) ;
577 sf_set_string (file, SF_STR_TITLE, new_title) ;
578 sf_set_string (file, SF_STR_SOFTWARE, new_software) ;
579 sf_set_string (file, SF_STR_ARTIST, new_artist) ;
581 sf_set_string (file, SF_STR_COPYRIGHT, copyright) ;
582 sf_set_string (file, SF_STR_COMMENT, comment) ;
583 sf_set_string (file, SF_STR_DATE, date) ;
584 sf_set_string (file, SF_STR_ALBUM, album) ;
585 sf_set_string (file, SF_STR_LICENSE, license) ;
586 sf_set_string (file, SF_STR_COPYRIGHT, new_copyright) ;
587 sf_set_string (file, SF_STR_COMMENT, comment) ;
588 sf_set_string (file, SF_STR_DATE, date) ;
589 sf_set_string (file, SF_STR_ALBUM, album) ;
590 sf_set_string (file, SF_STR_LICENSE, license) ;
592 sf_close (file) ;
594 file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ;
595 sf_command (file, SFC_GET_LOG_INFO, buffer, sizeof (buffer)) ;
596 sf_close (file) ;
621 { SNDFILE *file ;
631 file = test_open_file_or_die (filename, SFM_RDWR, &sfinfo, SF_FALSE, __LINE__) ;
633 sf_set_string (file, SF_STR_TITLE, title) ;
634 sf_close (file) ;
636 file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_FALSE, __LINE__) ;
638 str = sf_get_string (file, SF_STR_TITLE) ;
641 sf_close (file) ;
643 file = test_open_file_or_die (filename, SFM_RDWR, &sfinfo, SF_FALSE, __LINE__) ;
645 sf_set_string (file, SF_STR_TITLE, title) ;
646 sf_close (file) ;
648 file = test_open_file_or_die (filename, SFM_RDWR, &sfinfo, SF_FALSE, __LINE__) ;
649 str = sf_get_string (file, SF_STR_TITLE) ;
651 sf_set_string (file, SF_STR_ARTIST, artist) ;
652 sf_close (file) ;
654 file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_FALSE, __LINE__) ;
656 str = sf_get_string (file, SF_STR_ARTIST) ;
660 str = sf_get_string (file, SF_STR_TITLE) ;
666 sf_close (file) ;
674 { SNDFILE *file ;
688 file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_FALSE, __LINE__) ;
690 /* Write data to file. */
691 test_write_short_or_die (file, 0, data_out, BUFFER_LEN, __LINE__) ;
693 sf_set_string (file, SF_STR_TITLE, long_title) ;
694 sf_set_string (file, SF_STR_ARTIST, long_artist) ;
695 sf_close (file) ;
697 /* Open the file RDWR. */
698 file = test_open_file_or_die (filename, SFM_RDWR, &sfinfo, SF_FALSE, __LINE__) ;
700 str = sf_get_string (file, SF_STR_TITLE) ;
703 str = sf_get_string (file, SF_STR_ARTIST) ;
708 sf_set_string (file, SF_STR_TITLE, title) ;
709 sf_set_string (file, SF_STR_ARTIST, artist) ;
711 sf_close (file) ;
713 file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_FALSE, __LINE__) ;
715 check_log_buffer_or_die (file, __LINE__) ;
717 str = sf_get_string (file, SF_STR_TITLE) ;
721 str = sf_get_string (file, SF_STR_ARTIST) ;
725 sf_close (file) ;
755 SNDFILE *file ;
759 file = test_open_file_or_die (filename, SFM_WRITE, &info, SF_TRUE, __LINE__) ;
763 exit_if_true (sf_set_string (file, SF_STR_SOFTWARE, sfname),
764 "\n\nLine %d : sf_set_string (f, SF_STR_SOFTWARE, '%s') failed : %s\n", __LINE__, sfname, sf_strerror (file)) ;
766 sf_close (file) ;
768 file = test_open_file_or_die (filename, SFM_READ, &info, SF_TRUE, __LINE__) ;
769 result = sf_get_string (file, SF_STR_SOFTWARE) ;
771 exit_if_true (result == NULL, "\n\nLine %d : sf_get_string (file, SF_STR_SOFTWARE) returned NULL.\n\n", __LINE__) ;
775 sf_close (file) ;
785 { SNDFILE *file ;
793 /* Create a file that contains some strings. Then open the file in RDWR mode and
794 grow the file by writing more audio data to it. Check that the audio data has
795 been added to the file, and that the strings are still there. */
797 /* Create a short file that contains a string. */
804 file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ;
805 /* Write data to file. */
806 test_write_short_or_die (file, 0, data_out, BUFFER_LEN, __LINE__) ;
808 /* Write some strings at end of file. */
809 sf_set_string (file, SF_STR_TITLE , title) ;
810 sf_set_string (file, SF_STR_COMMENT, comment) ;
811 sf_close (file) ;
814 /* Now open file again in SFM_RDWR mode and write more audio data to it. */
815 file = test_open_file_or_die (filename, SFM_RDWR, &sfinfo, SF_TRUE, __LINE__) ;
816 /* Write more data to file. */
817 test_write_short_or_die (file, 0, data_out, BUFFER_LEN, __LINE__) ;
818 sf_close (file) ;
821 /* Now open file again. It should now contain two BUFFER_LEN's worth of frames and the strings. */
823 file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ;
827 str = sf_get_string (file, SF_STR_TITLE) ;
831 str = sf_get_string (file, SF_STR_COMMENT) ;
835 sf_close (file) ;
843 { SNDFILE *file , *file1 ;
852 /* Create a short file. */
859 file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ;
860 test_write_short_or_die (file, 0, data_out, BUFFER_LEN, __LINE__) ;
861 sf_set_string (file, SF_STR_TITLE, long_title) ;
862 sf_close (file) ;
866 file = test_open_file_or_die (filename, SFM_RDWR, &sfinfo, SF_TRUE, __LINE__) ;
868 test_write_short_or_die (file, 0, data_out, GROW_BUFFER_AMOUNT, __LINE__) ;
870 /* Update the header without closing the file. */
871 sf_command (file, SFC_UPDATE_HEADER_NOW, NULL, 0) ;
873 /* The file should now contain BUFFER_LEN + GROW_BUFFER_AMOUNT frames.
874 Open a second handle to the file and check the reported length. */
885 sf_close (file) ;
889 file = test_open_file_or_die (filename, SFM_RDWR, &sfinfo, SF_TRUE, __LINE__) ;
891 test_write_short_or_die (file, 0, data_out, GROW_BUFFER_AMOUNT, __LINE__) ;
892 sf_close (file) ;
895 /* Open file again and verify data and string. */
896 file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ;
899 str = sf_get_string (file, SF_STR_TITLE) ;
902 sf_close (file) ;