Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions audioutils/rtttl-c/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/rtttl-c
21 changes: 21 additions & 0 deletions audioutils/rtttl-c/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
config AUDIOUTILS_RTTTL_C
bool "RTTTL parsing library"
default n
---help---
Simple library for parsing Ring Tone Text Transfer Language (RTTTL)

Define how to make a sound:

void
play_tone(struct rtttl_tone tone)
{
/* TODO: Make a sound with
* tone.frequency_100hz
* tone.period_us
* tone.duration_us
*/
}

and then play RTTTL string:

rtttl_play("...", play_tone);
25 changes: 25 additions & 0 deletions audioutils/rtttl-c/Make.defs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
############################################################################
# apps/audioutils/rtttl-c/Make.defs
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################

ifneq ($(CONFIG_AUDIOUTILS_RTTTL_C),)
CONFIGURED_APPS += $(APPDIR)/audioutils/rtttl-c
endif
44 changes: 44 additions & 0 deletions audioutils/rtttl-c/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
############################################################################
# apps/audioutils/rtttl-c/Makefile
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################

include $(APPDIR)/Make.defs

CSRCS = $(RTTTL_C_DIR)/rtttl.c

RTTTL_C_DIR = rtttl-c

$(RTTTL_C_DIR):
$(Q) echo "Cloning rtttl-c repo..."
$(Q) git clone --depth=1 https://git.sr.ht/~qeef/rtttl-c
$(Q) touch $(RTTTL_C_DIR)

create_includes: $(RTTTL_C_DIR)/rtttl.h
$(Q) cp $< $(APPDIR)/include/audioutils

context:: $(RTTTL_C_DIR)
$(Q) $(MAKE) create_includes

distclean::
$(call DELFILE, $(APPDIR)/include/audioutils/rtttl.h)
$(call DELDIR, rtttl-c)

include $(APPDIR)/Application.mk
Loading